summaryrefslogtreecommitdiff
path: root/examples/blog
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-04-23 10:44:41 -0600
committerGravatar GitHub <noreply@github.com> 2021-04-23 10:44:41 -0600
commit510e7920d267e8181f255d3b321bbfda11417d33 (patch)
tree8b202aa3df022116375fd2e5de46657fdf2e85cb /examples/blog
parent5eb232501f8f02236e52cf945b7fa3ce5a2ec260 (diff)
downloadastro-510e7920d267e8181f255d3b321bbfda11417d33.tar.gz
astro-510e7920d267e8181f255d3b321bbfda11417d33.tar.zst
astro-510e7920d267e8181f255d3b321bbfda11417d33.zip
Add RSS generation (#123)
Diffstat (limited to 'examples/blog')
-rw-r--r--examples/blog/astro/pages/$posts.astro13
1 files changed, 12 insertions, 1 deletions
diff --git a/examples/blog/astro/pages/$posts.astro b/examples/blog/astro/pages/$posts.astro
index da688c041..ebb20705d 100644
--- a/examples/blog/astro/pages/$posts.astro
+++ b/examples/blog/astro/pages/$posts.astro
@@ -18,7 +18,18 @@ export async function createCollection() {
allPosts.sort((a, b) => new Date(b.date) - new Date(a.date));
return allPosts;
},
- pageSize: 3
+ pageSize: 3,
+ rss: {
+ title: 'Muppet Blog',
+ description: 'An example blog on Astro',
+ customData: `<language>en-us</language>`,
+ item: (item) => ({
+ title: item.title,
+ description: item.description,
+ link: item.url,
+ pubDate: item.date,
+ }),
+ }
};
}
---