mirror of
https://github.com/tcsenpai/obsidiangarden_netlify.git
synced 2025-06-06 20:55:21 +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;
|
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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user