fix tag pages to emit to tag/index.html to override content and folder pages

This commit is contained in:
Jacky Zhao
2023-07-19 23:03:59 -07:00
parent 83d47f7aaa
commit 01d7d8e554
4 changed files with 20 additions and 19 deletions

View File

@ -29,15 +29,12 @@ export const FolderPage: QuartzEmitterPlugin<FullPageLayout> = (opts) => {
const folders: Set<CanonicalSlug> = new Set(allFiles.flatMap(data => {
const slug = data.slug
const folderName = path.dirname(slug ?? "") as CanonicalSlug
if (slug && folderName !== ".") {
if (slug && folderName !== "." && folderName !== "tags") {
return [folderName]
}
return []
}))
// remove special prefixes
folders.delete("tags" as CanonicalSlug)
const folderDescriptions: Record<string, ProcessedContent> = Object.fromEntries([...folders].map(folder => ([
folder, defaultProcessedContent({ slug: joinSegments(folder, "index") as ServerSlug, frontmatter: { title: `Folder: ${folder}`, tags: [] } })
])))