Update quartz/plugins/emitters/contentIndex.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Suryaansh Rai 2026-01-17 22:36:10 +05:30 committed by GitHub
parent bb23824ab3
commit b91651f9a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -153,7 +153,15 @@ export const ContentIndex: QuartzEmitterPlugin<Partial<Options>> = (opts) => {
let sortedTags: string[] = [] let sortedTags: string[] = []
if (opts.rssTags && opts.rssTags.length > 0) { if (opts.rssTags && opts.rssTags.length > 0) {
sortedTags = opts.rssTags // Only include user-specified tags that actually exist in the content
const availableTags = new Set<string>()
for (const [_, content] of linkIndex) {
const tags = content.tags.flatMap(getAllSegmentPrefixes)
for (const tag of tags) {
availableTags.add(tag)
}
}
sortedTags = opts.rssTags.filter((tag) => availableTags.has(tag))
} else if ((opts.rssTagsLimit ?? 0) > 0) { } else if ((opts.rssTagsLimit ?? 0) > 0) {
const tagCounts: Map<string, number> = new Map() const tagCounts: Map<string, number> = new Map()