0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Improve Collection docs for RSS (#990)

- Added missing but required link attribute
- Added note on how to create a full text feed
This commit is contained in:
Joshua Stübner 2021-08-03 14:18:25 +02:00 committed by GitHub
parent 418bc1d91c
commit 52ca7fafb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -245,6 +245,7 @@ export async function createCollection() {
},
rss: {
title: 'My RSS Feed',
// if you want a full text feed, add your markup here (e.g. item.astro.html)
description: 'Description of the feed',
// (optional) add xmlns:* properties to root element
xmlns: {
@ -260,7 +261,10 @@ export async function createCollection() {
description: item.description,
// enforce GMT timezone (otherwise it'll be different based on where it's built)
pubDate: item.pubDate + 'Z',
// custom data is supported here as well
// link is required, shows up in RSS readers
link: '/collection/' + item.id
// (optional) custom data is supported here as well
customData: ``<id>${Astro.site}collection/${item.id}</id>``
}),
},
};