You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
627 B

---
export async function getStaticPaths({paginate, rss}) {
console.log(Astro);
const allPosts = await Astro.glob('./*.md')
const posts = allPosts.map(item => (Object.assign({}, item.frontmatter, {url: item.url}))).sort((a, b) => new Date(b.date) - new Date(a.date));
rss({
title: "Ruthenic's Blog",
description: "My blog, utilized for talking about random things.",
items: posts.map(item => ({
title: item.title,
description: item.description,
link: item.url,
pubDate: item.date
})
).filter(item => (item.wip ? false : item)
),
dest: "/blog/feed.xml"
})
return paginate(posts)
}
---