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:
Cody Burleson 2023-05-02 09:29:57 -06:00 committed by GitHub
parent 66519a6ae1
commit 370f0fedb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {