Skip to content

Commit

Permalink
fix: string for aliases being treated as array of chars
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Aug 20, 2023
1 parent eb4d3dc commit e262482
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions quartz/plugins/emitters/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e262482

Please sign in to comment.