diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2024-02-03 14:08:16 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2024-02-03 14:08:16 -0500 |
| commit | 0077087a5179c2ffdec07ee38f3ffbbb01853dde (patch) | |
| tree | 8c21d9d6b2194909c90e5080a6fb75a3282f274c /src/pages/rss.xml.js | |
| parent | c7264e3ace8a6b1e22420702f00296a4bdadb6da (diff) | |
| download | personal-website-0077087a5179c2ffdec07ee38f3ffbbb01853dde.tar.gz personal-website-0077087a5179c2ffdec07ee38f3ffbbb01853dde.tar.bz2 personal-website-0077087a5179c2ffdec07ee38f3ffbbb01853dde.zip | |
Guestbook; No more hardcoded date
Diffstat (limited to 'src/pages/rss.xml.js')
| -rw-r--r-- | src/pages/rss.xml.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js deleted file mode 100644 index fe17f91..0000000 --- a/src/pages/rss.xml.js +++ /dev/null @@ -1,31 +0,0 @@ -import rss from '@astrojs/rss'; -import { getCollection } from "astro:content"; -import sanitizeHtml from 'sanitize-html'; -import MarkdownIt from 'markdown-it'; -const parser = new MarkdownIt(); - -export async function GET(context) { - const blog = await getCollection('blog'); - return rss({ - // `<title>` field in output xml - title: 'Andrew Lee', - // `<description>` field in output xml - description: 'Andrew Lee\'s Personal Blog', - // Pull in your project "site" from the endpoint context - // https://docs.astro.build/en/reference/api-reference/#contextsite - site: context.site, - // Array of `<item>`s in output xml - // See "Generating items" section for examples using content collections and glob imports - items: blog.map((post) => ({ - title: post.data.title, - pubDate: post.data.pubDate, - description: post.data.description, - // Compute RSS link from post `slug` - // This example assumes all posts are rendered as `/blog/[slug]` routes - link: `/blog/${post.slug}/`, - content: sanitizeHtml(parser.render(post.body)), - // (optional) inject custom xml - customData: `<language>en-us</language>`, - })), - }); -} |
