diff --git a/quartz/components/pages/TagContent.tsx b/quartz/components/pages/TagContent.tsx index a495af5c3..890755bbc 100644 --- a/quartz/components/pages/TagContent.tsx +++ b/quartz/components/pages/TagContent.tsx @@ -28,7 +28,11 @@ function TagContent(props: QuartzComponentProps) { : htmlToJsx(fileData.filePath!, tree) if (tag === "/") { - const tags = [...new Set(allFiles.flatMap((data) => data.frontmatter?.tags ?? []))] + const tags = [ + ...new Set( + allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes), + ), + ].sort((a, b) => a.localeCompare(b)) const tagItemMap: Map = new Map() for (const tag of tags) { tagItemMap.set(tag, allPagesWithTag(tag)) diff --git a/quartz/plugins/emitters/tagPage.tsx b/quartz/plugins/emitters/tagPage.tsx index ad5e1d649..566911983 100644 --- a/quartz/plugins/emitters/tagPage.tsx +++ b/quartz/plugins/emitters/tagPage.tsx @@ -40,6 +40,7 @@ export const TagPage: QuartzEmitterPlugin = (userOpts) => { const tags: Set = new Set( allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes), ) + // add base tag tags.add("index")