mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-24 23:15:46 -05:00
fix: fix aliases that can't be a Windows file name
See https://github.com/jackyzha0/quartz/issues/708
This commit is contained in:
parent
3faf2ff6f5
commit
3ccb0c43ae
@ -16,7 +16,11 @@ export const AliasRedirects: QuartzEmitterPlugin = () => ({
|
||||
for (const [_tree, file] of content) {
|
||||
const dir = path.posix.relative(argv.directory, path.dirname(file.data.filePath!))
|
||||
const aliases = file.data.frontmatter?.aliases ?? []
|
||||
const slugs = aliases.map((alias) => path.posix.join(dir, alias) as FullSlug)
|
||||
const slugs: FullSlug[] = aliases.map((alias) => {
|
||||
console.log(alias)
|
||||
const aliasWithNoInvalidFileSystemCharacters = alias.replace(/[\<\>\?\|\:]/g, '-');
|
||||
return path.posix.join(dir, aliasWithNoInvalidFileSystemCharacters) as FullSlug
|
||||
});
|
||||
const permalink = file.data.frontmatter?.permalink
|
||||
if (typeof permalink === "string") {
|
||||
slugs.push(permalink as FullSlug)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user