From 2f7bcbd502d247d6fa8360012bd2adcd7bcb1ca6 Mon Sep 17 00:00:00 2001 From: Anton Bulakh Date: Tue, 24 Dec 2024 02:03:09 +0200 Subject: [PATCH] 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. --- quartz/plugins/emitters/tagPage.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quartz/plugins/emitters/tagPage.tsx b/quartz/plugins/emitters/tagPage.tsx index 066d4ec26..d82a537db 100644 --- a/quartz/plugins/emitters/tagPage.tsx +++ b/quartz/plugins/emitters/tagPage.tsx @@ -105,6 +105,9 @@ export const TagPage: QuartzEmitterPlugin> = (userOpts) const tag = slug.slice("tags/".length) if (tags.has(tag)) { tagDescriptions[tag] = [tree, file] + if (file.data.frontmatter?.title === tag) { + file.data.frontmatter.title = `${i18n(cfg.locale).pages.tagContent.tag}: ${tag}` + } } } }