Jacky Zhao
2023-12-17 d2be097b7698c2548915c386aab07ceb320855aa
feat: include tag hierarchies in tag listing, sort tag listing
2 files modified
7 ■■■■ changed files
quartz/components/pages/TagContent.tsx 6 ●●●● patch | view | raw | blame | history
quartz/plugins/emitters/tagPage.tsx 1 ●●●● patch | view | raw | blame | history
quartz/components/pages/TagContent.tsx
@@ -28,7 +28,11 @@
      : 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<string, QuartzPluginData[]> = new Map()
    for (const tag of tags) {
      tagItemMap.set(tag, allPagesWithTag(tag))
quartz/plugins/emitters/tagPage.tsx
@@ -40,6 +40,7 @@
      const tags: Set<string> = new Set(
        allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes),
      )
      // add base tag
      tags.add("index")