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; 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) { function getPermalinkMeta(note, key) {
let permalink = "/"; let permalink = "/";
let parts = note.filePathStem.split("/"); let parts = note.filePathStem.split("/");
@ -85,8 +79,7 @@ function getPermalinkMeta(note, key) {
} else { } else {
folders = note.filePathStem folders = note.filePathStem
.split("notes/")[1] .split("notes/")[1]
.split("/") .split("/");
.map(toTitleCase);
} }
folders[folders.length - 1]+= ".md"; folders[folders.length - 1]+= ".md";
} catch { } catch {