do not remove "index" from the end of file

- should be treated as a regular file name
- it's up to the app how to interpret those paths/files later
This commit is contained in:
Ola Rubaj
2024-05-09 02:10:10 +02:00
parent 85de6f7878
commit 2ac82367c5
3 changed files with 4 additions and 158 deletions

View File

@@ -38,6 +38,5 @@ const defaultPathToPermalinkFunc = (
.replace(markdownFolder, "") // make the permalink relative to the markdown folder
.replace(/\.(mdx|md)/, "")
.replace(/\\/g, "/") // replace windows backslash with forward slash
.replace(/\/index$/, ""); // remove index from the end of the permalink
return permalink.length > 0 ? permalink : "/"; // for home page
};