mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-04 12:00:02 +00:00
Avoid manipulating folder case (#143)
* Avoid transforming folder label case --------- Co-authored-by: Cody Burleson <cody.burleson@cnhind.com> Co-authored-by: Ole Eskild Steensen <oleeskild@users.noreply.github.com>
This commit is contained in:
parent
66519a6ae1
commit
370f0fedb3
@ -45,12 +45,6 @@ const sortTree = (unsorted) => {
|
||||
return orderedTree;
|
||||
};
|
||||
|
||||
function toTitleCase(str) {
|
||||
return str.replace(/\w\S*/g, function (txt) {
|
||||
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
|
||||
});
|
||||
}
|
||||
|
||||
function getPermalinkMeta(note, key) {
|
||||
let permalink = "/";
|
||||
let parts = note.filePathStem.split("/");
|
||||
@ -65,7 +59,7 @@ function getPermalinkMeta(note, key) {
|
||||
}
|
||||
if (note.data.tags && note.data.tags.indexOf("gardenEntry") != -1) {
|
||||
permalink = "/";
|
||||
}
|
||||
}
|
||||
if (note.data.title) {
|
||||
name = note.data.title;
|
||||
}
|
||||
@ -85,8 +79,7 @@ function getPermalinkMeta(note, key) {
|
||||
} else {
|
||||
folders = note.filePathStem
|
||||
.split("notes/")[1]
|
||||
.split("/")
|
||||
.map(toTitleCase);
|
||||
.split("/");
|
||||
}
|
||||
folders[folders.length - 1]+= ".md";
|
||||
} catch {
|
||||
|
Loading…
x
Reference in New Issue
Block a user