From e26248292179ebb691dfa99621192b2258c9b9c3 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 19 Aug 2023 21:59:01 -0700 Subject: [PATCH] fix: string for aliases being treated as array of chars --- quartz/plugins/emitters/aliases.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/quartz/plugins/emitters/aliases.ts b/quartz/plugins/emitters/aliases.ts index 62879f7..c7294a3 100644 --- a/quartz/plugins/emitters/aliases.ts +++ b/quartz/plugins/emitters/aliases.ts @@ -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) {