mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-01 06:28:14 +00:00
This commit is contained in:
parent
36548d5986
commit
b444c5c13b
3 changed files with 10 additions and 4 deletions
quartz/util
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue