fix: string for aliases being treated as array of chars
This commit is contained in:
parent
604fc3be04
commit
6edcfc0a9c
@ -14,11 +14,9 @@ export const AliasRedirects: QuartzEmitterPlugin = () => ({
|
|||||||
const ogSlug = simplifySlug(file.data.slug!)
|
const ogSlug = simplifySlug(file.data.slug!)
|
||||||
const dir = path.posix.relative(argv.directory, file.dirname ?? argv.directory)
|
const dir = path.posix.relative(argv.directory, file.dirname ?? argv.directory)
|
||||||
|
|
||||||
let aliases: FullSlug[] = []
|
let aliases: FullSlug[] = file.data.frontmatter?.aliases ?? file.data.frontmatter?.alias ?? []
|
||||||
if (file.data.frontmatter?.aliases) {
|
if (typeof aliases === "string") {
|
||||||
aliases = file.data.frontmatter?.aliases
|
aliases = [aliases]
|
||||||
} else if (file.data.frontmatter?.alias) {
|
|
||||||
aliases = [file.data.frontmatter?.alias]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const alias of aliases) {
|
for (const alias of aliases) {
|
||||||
|
Loading…
Reference in New Issue
Block a user