diff options
author | 2022-01-19 14:34:52 -0600 | |
---|---|---|
committer | 2022-01-19 15:34:52 -0500 | |
commit | 85ad1aab67b9f1b9214db3200458ac37675b9afb (patch) | |
tree | 1050a6c2c6579bcaf7ba4ef8e43be4a7053708af /docs/src | |
parent | 04c2e2e4cdba09ed3eecf4fce56420f4f1566656 (diff) | |
download | astro-85ad1aab67b9f1b9214db3200458ac37675b9afb.tar.gz astro-85ad1aab67b9f1b9214db3200458ac37675b9afb.tar.zst astro-85ad1aab67b9f1b9214db3200458ac37675b9afb.zip |
feat: add support for styled RSS feeds (#2371)
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/pages/en/guides/rss.md | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/docs/src/pages/en/guides/rss.md b/docs/src/pages/en/guides/rss.md index 67e135604..b40fa98de 100644 --- a/docs/src/pages/en/guides/rss.md +++ b/docs/src/pages/en/guides/rss.md @@ -4,7 +4,7 @@ title: RSS description: An intro to RSS in Astro --- -Astro supports fast, automatic RSS feed generation for blogs and other content websites. +Astro supports fast, automatic RSS feed generation for blogs and other content websites. For more information about RSS feeds in general, see [aboutfeeds.com](https://aboutfeeds.com/). You can create an RSS feed from any Astro page that uses a `getStaticPaths()` function for routing. Only dynamic routes can use `getStaticPaths()` today (see [Routing](/en/core-concepts/routing)). @@ -22,6 +22,8 @@ export async function getStaticPaths({rss}) { rss({ // The RSS Feed title, description, and custom metadata. title: 'Don\'s Blog', + // See "Styling" section below + stylesheet: true, description: 'An example blog on Astro', customData: `<language>en-us</language>`, // The list of items for your RSS feed, sorted. @@ -41,3 +43,11 @@ export async function getStaticPaths({rss}) { ``` Note: RSS feeds will **not** be built during development. Currently, RSS feeds are only generated during your final build. + +### Styling + +RSS Feeds can be styled with an XSL stylesheet for a more pleasant user experience when they are opened directly in a browser. By default, Astro does not set a stylesheet for RSS feeds, but it can be enabled by setting the `stylesheet` option. + +Astro can automatically use [Pretty Feed](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl), a popular open-source XSL stylesheet. To enable this behavior, pass `stylesheet: true`. + +If you'd like to use a custom XSL stylesheet, you can pass a string value like `stylesheet: '/my-custom-stylesheet.xsl'`. This file should be in your `public/` directory (in this case, `public/my-custom-stylesheet.xsl`). |