| | |
| | | |
| | | return graph |
| | | }, |
| | | async emit(ctx, content, resources): Promise<FilePath[]> { |
| | | const fps: FilePath[] = [] |
| | | async *emit(ctx, content, resources) { |
| | | const allFiles = content.map((c) => c[1].data) |
| | | const cfg = ctx.cfg.configuration |
| | | |
| | |
| | | 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}` |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (const tag of tags) { |
| | | const slug = joinSegments("tags", tag) as FullSlug |
| | | const externalResources = pageResources(pathToRoot(slug), resources) |
| | | const [tree, file] = tagDescriptions[tag] |
| | | const externalResources = pageResources(pathToRoot(slug), file.data, resources) |
| | | const componentData: QuartzComponentProps = { |
| | | ctx, |
| | | fileData: file.data, |
| | |
| | | } |
| | | |
| | | const content = renderPage(cfg, slug, componentData, opts, externalResources) |
| | | const fp = await write({ |
| | | yield write({ |
| | | ctx, |
| | | content, |
| | | slug: file.data.slug!, |
| | | ext: ".html", |
| | | }) |
| | | |
| | | fps.push(fp) |
| | | } |
| | | return fps |
| | | }, |
| | | } |
| | | } |