mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-02-03 22:15:42 -06:00
Update quartz/plugins/emitters/contentIndex.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
bb23824ab3
commit
b91651f9a7
@ -153,7 +153,15 @@ export const ContentIndex: QuartzEmitterPlugin<Partial<Options>> = (opts) => {
|
||||
let sortedTags: string[] = []
|
||||
|
||||
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) {
|
||||
const tagCounts: Map<string, number> = new Map()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user