Jacky Zhao
2023-11-11 bf603c49c2edaa5fcbe42479421a336dcacf92b9
fix: sort rss feed by date
1 files modified
2 ■■■■■ changed files
quartz/plugins/emitters/contentIndex.ts 2 ●●●●● patch | view | raw | blame | history
quartz/plugins/emitters/contentIndex.ts
@@ -6,6 +6,7 @@
import { QuartzEmitterPlugin } from "../types"
import { toHtml } from "hast-util-to-html"
import path from "path"
import { byDateAndAlphabetical } from "../../components/PageList"
export type ContentIndex = Map<FullSlug, ContentDetails>
export type ContentDetails = {
@@ -59,6 +60,7 @@
  </item>`
  const items = Array.from(idx)
    .sort((a, b) => byDateAndAlphabetical(cfg)(a[1], b[1]))
    .map(([slug, content]) => createURLEntry(simplifySlug(slug), content))
    .slice(0, limit ?? idx.size)
    .join("")