| | |
| | | import { pageResources, renderPage } from "../../components/renderPage" |
| | | import { ProcessedContent, defaultProcessedContent } from "../vfile" |
| | | import { FullPageLayout } from "../../cfg" |
| | | import { |
| | | CanonicalSlug, |
| | | FilePath, |
| | | ServerSlug, |
| | | getAllSegmentPrefixes, |
| | | joinSegments, |
| | | } from "../../path" |
| | | import { FilePath, FullSlug, getAllSegmentPrefixes, joinSegments } from "../../util/path" |
| | | import { defaultListPageLayout, sharedPageComponents } from "../../../quartz.layout" |
| | | import { TagContent } from "../../components" |
| | | |
| | |
| | | allFiles.flatMap((data) => data.frontmatter?.tags ?? []).flatMap(getAllSegmentPrefixes), |
| | | ) |
| | | // add base tag |
| | | tags.add("") |
| | | tags.add("index") |
| | | |
| | | const tagDescriptions: Record<string, ProcessedContent> = Object.fromEntries( |
| | | [...tags].map((tag) => { |
| | |
| | | return [ |
| | | tag, |
| | | defaultProcessedContent({ |
| | | slug: joinSegments("tags", tag, "index") as ServerSlug, |
| | | slug: joinSegments("tags", tag) as FullSlug, |
| | | frontmatter: { title, tags: [] }, |
| | | }), |
| | | ] |
| | |
| | | for (const [tree, file] of content) { |
| | | const slug = file.data.slug! |
| | | if (slug.startsWith("tags/")) { |
| | | const tag = joinSegments(slug.slice("tags/".length), "index") |
| | | const tag = slug.slice("tags/".length) |
| | | if (tags.has(tag)) { |
| | | tagDescriptions[tag] = [tree, file] |
| | | } |
| | |
| | | } |
| | | |
| | | for (const tag of tags) { |
| | | const slug = joinSegments("tags", tag) as CanonicalSlug |
| | | const slug = joinSegments("tags", tag) as FullSlug |
| | | const externalResources = pageResources(slug, resources) |
| | | const [tree, file] = tagDescriptions[tag] |
| | | const componentData: QuartzComponentProps = { |
| | |
| | | } |
| | | |
| | | const content = renderPage(slug, componentData, opts, externalResources) |
| | | |
| | | const fp = (file.data.slug + ".html") as FilePath |
| | | await emit({ |
| | | const fp = await emit({ |
| | | content, |
| | | slug: file.data.slug!, |
| | | ext: ".html", |