From e1a5f40bc06cb8620631b2b8ec5c861c37aeb8dc Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Thu, 18 May 2023 09:53:19 -0500 Subject: [PATCH 01/13] add next steps --- src/content/docs/en/guides/rss.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index 9cf4b6d0dd0f7..d9ae8e008cdf5 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -208,3 +208,7 @@ rss({ ``` If you don't have an RSS stylesheet in mind, we recommend the [Pretty Feed v3 default stylesheet](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl), which you can download from GitHub and save into your project's `public/` directory. + +## Next Steps + +After visiting your feed in the browser (your-site.com/rss.xml) and confirming that you can see data about your posts, you can now [display your feed on your website](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have) so that readers can subscribe to it in their own feed reader. \ No newline at end of file From a3e820e51e1e14d36abd116878d99d1dac9d9caa Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Sat, 20 May 2023 12:40:26 -0500 Subject: [PATCH 02/13] edits --- src/content/docs/en/guides/rss.mdx | 43 +++++++++++++++++++----------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index d9ae8e008cdf5..3ac296c7da9b5 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -1,6 +1,6 @@ --- title: Add an RSS feed -description: Let users subscribe to your content by adding an RSS feed to your Astro site. +description: Add an RSS feed to your Astro site to let users subscribe to your content. i18nReady: true type: recipe --- @@ -8,13 +8,13 @@ import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro' import Since from '~/components/Since.astro' -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/). +Astro supports fast, automatic RSS feed generation for blogs and other content websites. RSS feeds provide an easy way for users to subscribe to your content. -## Setting up `@astrojs/rss` +## Setting up Your Feed -The [`@astrojs/rss` package](https://github.com/withastro/astro/tree/main/packages/astro-rss) provides helpers for generating RSS feeds using [API endpoints](/en/core-concepts/endpoints/#static-file-endpoints). This unlocks both static builds _and_ on-demand generation when using an [SSR adapter](/en/guides/server-side-rendering/#adding-an-adapter). +The package [`@astrojs/rss`](https://github.com/withastro/astro/tree/main/packages/astro-rss) provides helpers for generating RSS feeds using [API endpoints](/en/core-concepts/endpoints/#static-file-endpoints). This unlocks both static builds _and_ on-demand generation when using an [SSR adapter](/en/guides/server-side-rendering/#adding-an-adapter). -First, install `@astrojs/rss` using your preferred package manager: +Install `@astrojs/rss`: @@ -34,11 +34,13 @@ First, install `@astrojs/rss` using your preferred package manager: -Then, ensure you've [configured a `site`](/en/reference/configuration-reference/#site) in your project's `astro.config`. You will use this to generate links to your RSS articles. +:::tip +Ensure you've [configured a `site`](/en/reference/configuration-reference/#site) in your project's `astro.config`. This will be used to generate links to your RSS articles. +::: -Now, let's generate our first RSS feed! Create an `rss.xml.js` file under your `src/pages/` directory. `rss.xml` will be the output URL, so feel free to rename this if you prefer. +Now generate your first RSS feed! Create a file with the extension `.xml.js`. This will be used as the output URL. This example uses `rss.xml.js` and the output URL will be `rss.xml`. -Next, import the `rss` helper from the `@astrojs/rss` package and call with the following parameters: +Import the `rss` helper from the `@astrojs/rss` package and call it with the following parameters: ```js title="src/pages/rss.xml.js" import rss from '@astrojs/rss'; @@ -63,11 +65,11 @@ export function get(context) { ## Generating `items` -The `items` field accepts a list of RSS feed objects, each with a `link`, `title`, `pubDate`, and optional `description`, `content`, and `customData` fields. You can generate this array from a content collection or by using glob imports. +The `items` field accepts a list of RSS feed objects, each with a `link`, `title`, `pubDate`, and optional `description`, `content`, and `customData` fields. You can generate this array from a content collection or by using [glob imports.](/en/guides/imports/#astroglob) ### Using content collections -To create an RSS feed of pages managed in [content collections](/en/guides/content-collections/), you use the `getCollection()` function to retrieve the list of your items. +To create an RSS feed of pages managed in [content collections](/en/guides/content-collections/), use the `getCollection()` function to retrieve the list of your items. ```js title="src/pages/rss.xml.js" "items:" "const blog = await getCollection('blog');" @@ -93,7 +95,7 @@ export async function get(context) { } ``` -You can configure your collection schema to enforce these expected RSS properties. Import and apply `rssSchema` to ensure that each collection entry produces a valid RSS feed item. +Configure your collection schema to enforce these expected RSS properties. Import and apply `rssSchema` to ensure that each collection entry produces a valid RSS feed item. ```js title="src/content/config.ts" "rssSchema" import { defineCollection } from 'astro:content'; @@ -112,7 +114,9 @@ export const collections = { blog }; To create an RSS feed from documents in `src/pages/`, use the `pagesGlobToRssItems()` helper. This accepts an [`import.meta.glob`](https://vitejs.dev/guide/features.html#glob-import) result and outputs an array of valid RSS feed items (see [more about writing glob patterns](/en/guides/imports/#glob-patterns) for specifying which pages to include). +:::warn This function assumes, but does not verify, that all necessary feed properties are present in each document's frontmatter. If you encounter errors, verify each page frontmatter manually. +::: ```js title="src/pages/rss.xml.js" "pagesGlobToRssItems" "await pagesGlobToRssItems(" import rss, { pagesGlobToRssItems } from '@astrojs/rss'; @@ -143,7 +147,7 @@ items: import.meta.glob('./blog/*.{md,mdx}'), The `content` key contains the full content of the post as HTML. This allows you to make your entire post content available to RSS feed readers. :::tip -Whenever you're using HTML content in XML, we suggest using a package like [`sanitize-html`](https://www.npmjs.com/package/sanitize-html) in order to make sure that your content is properly sanitized, escaped, and encoded. +A package like [`sanitize-html`](https://www.npmjs.com/package/sanitize-html) will make sure that your content is properly sanitized, escaped, and encoded. ::: When using content collections, render the post `body` using a standard Markdown parser like [`markdown-it`](https://github.com/markdown-it/markdown-it) and sanitize the result: @@ -171,7 +175,7 @@ export async function get(context) { } ``` -When using glob imports with Markdown, we suggest using the `compiledContent()` helper to retrieve the rendered HTML for sanitization. Note: this feature is **not** supported for MDX files. +When using glob imports with Markdown, you may use the `compiledContent()` helper to retrieve the rendered HTML for sanitization. Note: this feature is **not** supported for MDX files. ```js title="src/pages/rss.xml.js" ins={2, 13} import rss from '@astrojs/rss'; @@ -195,7 +199,7 @@ export function get(context) { ## Adding a stylesheet -You can style your RSS feed for a more pleasant user experience when viewing the file in your browser. +Style your RSS feed for a more pleasant user experience when viewing the file in your browser. Use the `rss` function's `stylesheet` option to specify an absolute path to your stylesheet. @@ -207,8 +211,15 @@ rss({ }); ``` -If you don't have an RSS stylesheet in mind, we recommend the [Pretty Feed v3 default stylesheet](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl), which you can download from GitHub and save into your project's `public/` directory. +:::tip +If you'd prefer not to create your own stylesheet, you may use a premade stylesheet such as the [Pretty Feed v3 default stylesheet](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl). Download the stylesheet from GitHub and save into your project's `public/` directory. +::: ## Next Steps -After visiting your feed in the browser (your-site.com/rss.xml) and confirming that you can see data about your posts, you can now [display your feed on your website](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have) so that readers can subscribe to it in their own feed reader. \ No newline at end of file +After visiting your feed in the browser (your-site.com/rss.xml) and confirming that you can see data about your posts, you can now [display your feed on your website](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have) so that readers can subscribe to it in their own feed reader. + + +## Resources + +- [RSS Feeds](https://aboutfeeds.com/) From ff089a9d1a2a4d140b0bbd0b72590675abe8f21c Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Sat, 20 May 2023 15:16:42 -0500 Subject: [PATCH 03/13] fix links by reverting header name change --- src/content/docs/en/guides/rss.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index 3ac296c7da9b5..8d379cf18f6f5 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -10,7 +10,7 @@ import Since from '~/components/Since.astro' Astro supports fast, automatic RSS feed generation for blogs and other content websites. RSS feeds provide an easy way for users to subscribe to your content. -## Setting up Your Feed +## Setting up `@astrojs/rss` The package [`@astrojs/rss`](https://github.com/withastro/astro/tree/main/packages/astro-rss) provides helpers for generating RSS feeds using [API endpoints](/en/core-concepts/endpoints/#static-file-endpoints). This unlocks both static builds _and_ on-demand generation when using an [SSR adapter](/en/guides/server-side-rendering/#adding-an-adapter). @@ -212,7 +212,7 @@ rss({ ``` :::tip -If you'd prefer not to create your own stylesheet, you may use a premade stylesheet such as the [Pretty Feed v3 default stylesheet](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl). Download the stylesheet from GitHub and save into your project's `public/` directory. +If you'd prefer not to create your own stylesheet, you may use a premade stylesheet such as the [Pretty Feed v3 default stylesheet.](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl) Download the stylesheet from GitHub and save into your project's `public/` directory. ::: ## Next Steps From 031300734ca9d6d41d75e5be9b7d9b2eac3a6f57 Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Mon, 22 May 2023 11:29:45 -0500 Subject: [PATCH 04/13] Update src/content/docs/en/guides/rss.mdx Co-authored-by: Sarah Rainsberger --- src/content/docs/en/guides/rss.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index 8d379cf18f6f5..ce8af30f8a048 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -38,7 +38,9 @@ Install `@astrojs/rss`: Ensure you've [configured a `site`](/en/reference/configuration-reference/#site) in your project's `astro.config`. This will be used to generate links to your RSS articles. ::: -Now generate your first RSS feed! Create a file with the extension `.xml.js`. This will be used as the output URL. This example uses `rss.xml.js` and the output URL will be `rss.xml`. +2. Create a file in `src/pages/` with a name of your choice and the extension `.xml.js` to be used as the output URL for your feed. Some common RSS feed URL names are `feed.xml` or `rss.xml`. + +The example file below `src/pages/rss.xml.js` will create an RSS feed at `site/rss.xml`. Import the `rss` helper from the `@astrojs/rss` package and call it with the following parameters: From 7e71fc07c987d1da9341e3dd6d3b28ecea00c412 Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Mon, 22 May 2023 11:29:57 -0500 Subject: [PATCH 05/13] Update src/content/docs/en/guides/rss.mdx Co-authored-by: Sarah Rainsberger --- src/content/docs/en/guides/rss.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index ce8af30f8a048..47a14b1548fd4 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -14,7 +14,7 @@ Astro supports fast, automatic RSS feed generation for blogs and other content w The package [`@astrojs/rss`](https://github.com/withastro/astro/tree/main/packages/astro-rss) provides helpers for generating RSS feeds using [API endpoints](/en/core-concepts/endpoints/#static-file-endpoints). This unlocks both static builds _and_ on-demand generation when using an [SSR adapter](/en/guides/server-side-rendering/#adding-an-adapter). -Install `@astrojs/rss`: +1. Install `@astrojs/rss` using your preferred package manager: From da49629cc9ecced1416d976d7fdb043e5132a739 Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Mon, 22 May 2023 11:30:08 -0500 Subject: [PATCH 06/13] Update src/content/docs/en/guides/rss.mdx Co-authored-by: Sarah Rainsberger --- src/content/docs/en/guides/rss.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index 47a14b1548fd4..e7f98c5858b2d 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -42,7 +42,7 @@ Ensure you've [configured a `site`](/en/reference/configuration-reference/#site) The example file below `src/pages/rss.xml.js` will create an RSS feed at `site/rss.xml`. -Import the `rss` helper from the `@astrojs/rss` package and call it with the following parameters: +3. Import the `rss()` helper from the `@astrojs/rss` package into your `.xml.js` file and export a function that returns it using the following parameters: ```js title="src/pages/rss.xml.js" import rss from '@astrojs/rss'; From a4cf2a4c15551e879d22a97ad801fb8b966f1e45 Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Mon, 22 May 2023 11:30:19 -0500 Subject: [PATCH 07/13] Update src/content/docs/en/guides/rss.mdx Co-authored-by: Sarah Rainsberger --- src/content/docs/en/guides/rss.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index e7f98c5858b2d..11d53d7c2a521 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -67,7 +67,10 @@ export function get(context) { ## Generating `items` -The `items` field accepts a list of RSS feed objects, each with a `link`, `title`, `pubDate`, and optional `description`, `content`, and `customData` fields. You can generate this array from a content collection or by using [glob imports.](/en/guides/imports/#astroglob) +The `items` field accepts a list of RSS feed objects, each with a required `link`, `title`, and `pubDate`. Three optional values may be also be included `description` (a short excerpt), `content` (the full content of your post), and a `customData` field for including any extra data, such as other frontmatter properties from your blog posts. + +You can generate this array from a content collection schema or by using [glob imports](/en/guides/imports/#astroglob) for blog posts located within `src/pages/`. + ### Using content collections From 341b5253969974e285180ad26ca04d0176bb5f5b Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Mon, 22 May 2023 11:30:36 -0500 Subject: [PATCH 08/13] Update src/content/docs/en/guides/rss.mdx Co-authored-by: Sarah Rainsberger --- src/content/docs/en/guides/rss.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index 11d53d7c2a521..ebc71e03b4432 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -100,7 +100,9 @@ export async function get(context) { } ``` -Configure your collection schema to enforce these expected RSS properties. Import and apply `rssSchema` to ensure that each collection entry produces a valid RSS feed item. +Optional: replace your existing blog collection schema to enforce the expected RSS properties. + +To ensure that every blog entry produces a valid RSS feed item, you can optionally import and apply `rssSchema` instead of defining each individual property of your schema. ```js title="src/content/config.ts" "rssSchema" import { defineCollection } from 'astro:content'; From b2199ae1ca559b13b68d2495c10fa8767c5704fe Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Mon, 22 May 2023 11:31:58 -0500 Subject: [PATCH 09/13] Update src/content/docs/en/guides/rss.mdx Co-authored-by: Sarah Rainsberger --- src/content/docs/en/guides/rss.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index ebc71e03b4432..c880632c714b1 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -224,7 +224,7 @@ If you'd prefer not to create your own stylesheet, you may use a premade stylesh ## Next Steps -After visiting your feed in the browser (your-site.com/rss.xml) and confirming that you can see data about your posts, you can now [display your feed on your website](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have) so that readers can subscribe to it in their own feed reader. +After visiting your feed in the browser at `your-domain.com/rss.xml` and confirming that you can see data for each of your posts, you can now [promote your feed on your website](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have). Adding the standard RSS icon to your site lets your readers know that they can subscribe to your posts in their own feed reader. ## Resources From a250f848a84ff139a44354be54c8840450987c90 Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Mon, 22 May 2023 15:10:20 -0500 Subject: [PATCH 10/13] move period --- src/content/docs/en/guides/rss.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index c880632c714b1..ee3920a0f5328 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -224,7 +224,7 @@ If you'd prefer not to create your own stylesheet, you may use a premade stylesh ## Next Steps -After visiting your feed in the browser at `your-domain.com/rss.xml` and confirming that you can see data for each of your posts, you can now [promote your feed on your website](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have). Adding the standard RSS icon to your site lets your readers know that they can subscribe to your posts in their own feed reader. +After visiting your feed in the browser at `your-domain.com/rss.xml` and confirming that you can see data for each of your posts, you can now [promote your feed on your website.](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have) Adding the standard RSS icon to your site lets your readers know that they can subscribe to your posts in their own feed reader. ## Resources From 53a385ff99798cc2f02c6785b3090bc8d53143e9 Mon Sep 17 00:00:00 2001 From: Jothsa <58094796+Jothsa@users.noreply.github.com> Date: Mon, 22 May 2023 19:11:31 -0500 Subject: [PATCH 11/13] fix punctuation --- src/content/docs/en/guides/rss.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index ee3920a0f5328..91d388ec50ef8 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -219,12 +219,12 @@ rss({ ``` :::tip -If you'd prefer not to create your own stylesheet, you may use a premade stylesheet such as the [Pretty Feed v3 default stylesheet.](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl) Download the stylesheet from GitHub and save into your project's `public/` directory. +If you'd prefer not to create your own stylesheet, you may use a premade stylesheet such as the [Pretty Feed v3 default stylesheet](https://github.com/genmon/aboutfeeds/blob/main/tools/pretty-feed-v3.xsl). Download the stylesheet from GitHub and save into your project's `public/` directory. ::: ## Next Steps -After visiting your feed in the browser at `your-domain.com/rss.xml` and confirming that you can see data for each of your posts, you can now [promote your feed on your website.](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have) Adding the standard RSS icon to your site lets your readers know that they can subscribe to your posts in their own feed reader. +After visiting your feed in the browser at `your-domain.com/rss.xml` and confirming that you can see data for each of your posts, you can now [promote your feed on your website](https://medium.com/samsung-internet-dev/add-rss-feeds-to-your-website-to-keep-your-core-readers-engaged-3179dca9c91e#:~:text=com/~deno%2Drss-,Advertising%20your%20RSS%20feed,-Now%20you%20have). Adding the standard RSS icon to your site lets your readers know that they can subscribe to your posts in their own feed reader. ## Resources From 84038461973980f44022ab84161ca3f309ffd37f Mon Sep 17 00:00:00 2001 From: Sarah Rainsberger Date: Tue, 23 May 2023 11:37:02 -0300 Subject: [PATCH 12/13] warn -> caution for custom aside --- src/content/docs/en/guides/rss.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index 91d388ec50ef8..f18ae009772a9 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -121,7 +121,7 @@ export const collections = { blog }; To create an RSS feed from documents in `src/pages/`, use the `pagesGlobToRssItems()` helper. This accepts an [`import.meta.glob`](https://vitejs.dev/guide/features.html#glob-import) result and outputs an array of valid RSS feed items (see [more about writing glob patterns](/en/guides/imports/#glob-patterns) for specifying which pages to include). -:::warn +:::caution This function assumes, but does not verify, that all necessary feed properties are present in each document's frontmatter. If you encounter errors, verify each page frontmatter manually. ::: From 3a8cd3c3bb9b13808919e41b5203d0f98c3c0017 Mon Sep 17 00:00:00 2001 From: Sarah Rainsberger Date: Wed, 24 May 2023 08:38:16 -0300 Subject: [PATCH 13/13] Yan could NOT let it be Co-authored-by: Yan Thomas <61414485+Yan-Thomas@users.noreply.github.com> --- src/content/docs/en/guides/rss.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/en/guides/rss.mdx b/src/content/docs/en/guides/rss.mdx index f18ae009772a9..ed5d221fc82fb 100644 --- a/src/content/docs/en/guides/rss.mdx +++ b/src/content/docs/en/guides/rss.mdx @@ -67,7 +67,7 @@ export function get(context) { ## Generating `items` -The `items` field accepts a list of RSS feed objects, each with a required `link`, `title`, and `pubDate`. Three optional values may be also be included `description` (a short excerpt), `content` (the full content of your post), and a `customData` field for including any extra data, such as other frontmatter properties from your blog posts. +The `items` field accepts a list of RSS feed objects, each with a required `link`, `title`, and `pubDate`. Three optional values may also be included `description` (a short excerpt), `content` (the full content of your post), and a `customData` field for including any extra data, such as other frontmatter properties from your blog posts. You can generate this array from a content collection schema or by using [glob imports](/en/guides/imports/#astroglob) for blog posts located within `src/pages/`.