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>
| | |
| | | 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. |
| | |
| | | - `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 |
| | |
| | | enableRSS: boolean |
| | | rssLimit?: number |
| | | rssFullHtml: boolean |
| | | rssSlug: string |
| | | includeEmptyFiles: boolean |
| | | } |
| | | |
| | |
| | | enableRSS: true, |
| | | rssLimit: 10, |
| | | rssFullHtml: false, |
| | | rssSlug: "index", |
| | | includeEmptyFiles: true, |
| | | } |
| | | |
| | |
| | | await write({ |
| | | ctx, |
| | | content: generateRSSFeed(cfg, linkIndex, opts.rssLimit), |
| | | slug: "index" as FullSlug, |
| | | slug: (opts?.rssSlug ?? "index") as FullSlug, |
| | | ext: ".xml", |
| | | }), |
| | | ) |