Emile Bangma
2025-03-05 c6f10b44f6878e76a416332f14e3681de8df40db
feat(rss): configurable RSS feed URL (#1806)

* feat(rss): configurable RSS feed URL

* Update docs/features/RSS Feed.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/features/RSS Feed.md

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jacky Zhao <j.zhao2k19@gmail.com>
3 files modified
10 ■■■■■ changed files
docs/features/RSS Feed.md 5 ●●●●● patch | view | raw | blame | history
docs/plugins/ContentIndex.md 1 ●●●● patch | view | raw | blame | history
quartz/plugins/emitters/contentIndex.ts 4 ●●● patch | view | raw | blame | history
docs/features/RSS Feed.md
@@ -1,5 +1,10 @@
Quartz emits an RSS feed for all the content on your site by generating an `index.xml` file that RSS readers can subscribe to. Because of the RSS spec, this requires the `baseUrl` property in your [[configuration]] to be set properly for RSS readers to pick it up properly.
> [!info]
> After deploying, the generated RSS link will be available at `https://${baseUrl}/index.xml` by default.
>
> The `index.xml` path can be customized by passing the `rssSlug` option to the [[ContentIndex]] plugin.
## Configuration
This functionality is provided by the [[ContentIndex]] plugin. See the plugin page for customization options.
docs/plugins/ContentIndex.md
@@ -17,6 +17,7 @@
- `enableRSS`: If `true` (default), produces an RSS feed (`index.xml`) with recent content updates.
- `rssLimit`: Defines the maximum number of entries to include in the RSS feed, helping to focus on the most recent or relevant content. Defaults to `10`.
- `rssFullHtml`: If `true`, the RSS feed includes full HTML content. Otherwise it includes just summaries.
- `rssSlug`: Slug to the generated RSS feed XML file. Defaults to `"index"`.
- `includeEmptyFiles`: If `true` (default), content files with no body text are included in the generated index and resources.
## API
quartz/plugins/emitters/contentIndex.ts
@@ -25,6 +25,7 @@
  enableRSS: boolean
  rssLimit?: number
  rssFullHtml: boolean
  rssSlug: string
  includeEmptyFiles: boolean
}
@@ -33,6 +34,7 @@
  enableRSS: true,
  rssLimit: 10,
  rssFullHtml: false,
  rssSlug: "index",
  includeEmptyFiles: true,
}
@@ -151,7 +153,7 @@
          await write({
            ctx,
            content: generateRSSFeed(cfg, linkIndex, opts.rssLimit),
            slug: "index" as FullSlug,
            slug: (opts?.rssSlug ?? "index") as FullSlug,
            ext: ".xml",
          }),
        )