mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 21:16:21 +00:00
fix: string for aliases being treated as array of chars
This commit is contained in:
parent
eb4d3dc5b4
commit
e262482921
1 changed files with 3 additions and 5 deletions
|
@ -14,11 +14,9 @@ export const AliasRedirects: QuartzEmitterPlugin = () => ({
|
|||
const ogSlug = simplifySlug(file.data.slug!)
|
||||
const dir = path.posix.relative(argv.directory, file.dirname ?? argv.directory)
|
||||
|
||||
let aliases: FullSlug[] = []
|
||||
if (file.data.frontmatter?.aliases) {
|
||||
aliases = file.data.frontmatter?.aliases
|
||||
} else if (file.data.frontmatter?.alias) {
|
||||
aliases = [file.data.frontmatter?.alias]
|
||||
let aliases: FullSlug[] = file.data.frontmatter?.aliases ?? file.data.frontmatter?.alias ?? []
|
||||
if (typeof aliases === "string") {
|
||||
aliases = [aliases]
|
||||
}
|
||||
|
||||
for (const alias of aliases) {
|
||||
|
|
Loading…
Reference in a new issue