Skip to content

Commit

Permalink
Add missing imports from astro:content (#2636)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElianCodes authored Feb 13, 2023
1 parent ecadebe commit 6d01a56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/en/guides/rss.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,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.
```js title="src/content/config.ts" "rssSchema"
import { defineCollection } from 'astro:content';
import { rssSchema } from '@astrojs/rss';
const blog = defineCollection({
Expand Down Expand Up @@ -147,8 +148,9 @@ Whenever you're using HTML content in XML, we suggest using a package like [`san
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:
```js title="src/pages/rss.xml.js" ins={2, 3, 4, 15}
```js title="src/pages/rss.xml.js" ins={3, 4, 5, 16}
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import sanitizeHtml from 'sanitize-html';
import MarkdownIt from 'markdown-it';
const parser = new MarkdownIt();
Expand Down

0 comments on commit 6d01a56

Please sign in to comment.