diff options
Diffstat (limited to 'packages/astro-rss/README.md')
-rw-r--r-- | packages/astro-rss/README.md | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/packages/astro-rss/README.md b/packages/astro-rss/README.md index 268f58f26..c8485b02e 100644 --- a/packages/astro-rss/README.md +++ b/packages/astro-rss/README.md @@ -28,7 +28,7 @@ Start by [adding a `site` to your project's `astro.config` for link generation]( import rss from '@astrojs/rss'; import { getCollection } from 'astro:content'; -export async function get(context) { +export async function GET(context) { const posts = await getCollection('blog'); return rss({ title: 'Buzz’s Blog', @@ -55,7 +55,7 @@ Read **[Astro's RSS docs][astro-rss]** for more on using content collections, an The `rss` default export offers a number of configuration options. Here's a quick reference: ```js -export function get(context) { +export function GET(context) { return rss({ // `<title>` field in output xml title: 'Buzz’s Blog', @@ -98,7 +98,7 @@ The base URL to use when generating RSS item links. We recommend using the [endp ```ts import rss from '@astrojs/rss'; -export const get = (context) => +export const GET = (context) => rss({ site: context.site, // ... @@ -113,14 +113,6 @@ A list of formatted RSS feed items. See [Astro's RSS items documentation](https: When providing a formatted RSS item list, see the [`RSSFeedItem` type reference](#rssfeeditem). -### drafts - -Type: `boolean (optional)` - -**Deprecated**: Manually filter `items` instead. - -Set `drafts: true` to include [draft posts](https://docs.astro.build/en/guides/markdown-content/#draft-pages) in the feed output. By default, this option is `false` and draft posts are not included. - ### stylesheet Type: `string (optional)` @@ -136,7 +128,7 @@ A string of valid XML to be injected between your feed's `<description>` and `<i ```js import rss from '@astrojs/rss'; -export const get = () => rss({ +export const GET = () => rss({ ... customData: '<language>en-us</language>', }); @@ -181,7 +173,7 @@ By default, the library will add trailing slashes to the emitted URLs. To preven ```js import rss from '@astrojs/rss'; -export const get = () => +export const GET = () => rss({ trailingSlash: false, }); @@ -361,7 +353,7 @@ This function assumes, but does not verify, you are globbing for items inside `s // src/pages/rss.xml.js import rss, { pagesGlobToRssItems } from '@astrojs/rss'; -export async function get(context) { +export async function GET(context) { return rss({ title: 'Buzz’s Blog', description: 'A humble Astronaut’s guide to the stars', @@ -379,7 +371,7 @@ As `rss()` returns a `Response`, you can also use `getRssString()` to get the RS // src/pages/rss.xml.js import { getRssString } from '@astrojs/rss'; -export async function get(context) { +export async function GET(context) { const rssString = await getRssString({ title: 'Buzz’s Blog', ... |