Skip to content

Commit

Permalink
Avoid manipulating folder case (#143)
Browse files Browse the repository at this point in the history
* Avoid transforming folder label case
---------

Co-authored-by: Cody Burleson <[email protected]>
Co-authored-by: Ole Eskild Steensen <[email protected]>
  • Loading branch information
3 people authored May 2, 2023
1 parent 66519a6 commit 370f0fe
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/helpers/filetreeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("/");
Expand All @@ -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;
}
Expand All @@ -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 {
Expand Down

0 comments on commit 370f0fe

Please sign in to comment.