Comment out RSS call in example (#1302)

* Comment out RSS call in example

* Update [...page].astro

Co-authored-by: Fred K. Schott <fkschott@gmail.com>
This commit is contained in:
Tushar Sadhwani 2021-09-03 23:20:05 +05:30 committed by GitHub
parent 231020368e
commit 373e44d0a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,19 +14,21 @@ import authorData from '../../data/authors.json';
export async function getStaticPaths({paginate, rss}) { export async function getStaticPaths({paginate, rss}) {
const allPosts = Astro.fetchContent('../post/*.md'); const allPosts = Astro.fetchContent('../post/*.md');
const sortedPosts = allPosts.sort((a, b) => new Date(b.date) - new Date(a.date)); const sortedPosts = allPosts.sort((a, b) => new Date(b.date) - new Date(a.date));
// Generate an RSS feed from this collection
// TODO: DONT MERGE: This requires buildOptions.site to be set, which can't be set in a template // Generate an RSS feed from this collection of posts.
rss({ // NOTE: This is disabled by default, since it requires `buildOptions.site` to be set in your "astro.config.mjs" file.
title: 'Dons Blog', // rss({
description: 'An example blog on Astro', // title: 'Dons Blog',
customData: `<language>en-us</language>`, // description: 'An example blog on Astro',
items: sortedPosts.map(item => ({ // customData: `<language>en-us</language>`,
title: item.title, // items: sortedPosts.map(item => ({
description: item.description, // title: item.title,
link: item.url, // description: item.description,
pubDate: item.date, // link: item.url,
})), // pubDate: item.date,
}); // })),
// });
// Return a paginated collection of paths for all posts // Return a paginated collection of paths for all posts
return paginate(sortedPosts, {pageSize: 1}); return paginate(sortedPosts, {pageSize: 1});
} }