mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-28 07:14:05 -06:00
fix(tags): Set consistent titles for tags with description pages
Right now for some tag `my-tag` a tag page with title `Tag: my-tag` is generated. However if you create a page `tags/my-tag.md` to add a description the page will have the title `my-tag` by default. Set the tag page title to have the `Tag: ` prefix if the tag page does not have a custom title for consistency between tags with and without descriptions.
This commit is contained in:
parent
a582505daf
commit
2f7bcbd502
@ -105,6 +105,9 @@ export const TagPage: QuartzEmitterPlugin<Partial<TagPageOptions>> = (userOpts)
|
|||||||
const tag = slug.slice("tags/".length)
|
const tag = slug.slice("tags/".length)
|
||||||
if (tags.has(tag)) {
|
if (tags.has(tag)) {
|
||||||
tagDescriptions[tag] = [tree, file]
|
tagDescriptions[tag] = [tree, file]
|
||||||
|
if (file.data.frontmatter?.title === tag) {
|
||||||
|
file.data.frontmatter.title = `${i18n(cfg.locale).pages.tagContent.tag}: ${tag}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user