fix: percent-encoding for files with %, contentIndex for non-latin chars (closes #397, closes #399)

This commit is contained in:
Jacky Zhao committed 2023-08-22 23:34:28 -07:00
1 parent 36548d5986
commit b444c5c13b
3 files changed
+10 -4

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ export function slugifyFilePath(fp: FilePath, excludeExt?: boolean): FullSlug {
let slug = withoutFileExt
.split("/")
.map((segment) => segment.replace(/\s/g, "-")) // slugify all segments
.map((segment) => segment.replace(/\s/g, "-").replace(/%/g, "-percent")) // slugify all segments
.join("/") // always use / as sep
.replace(/\/$/, "") // remove trailing slash