diff --git a/src/pages/feed.xml.ts b/src/pages/feed.xml.ts index 5c9b7b4..f5b8016 100644 --- a/src/pages/feed.xml.ts +++ b/src/pages/feed.xml.ts @@ -15,9 +15,6 @@ export async function GET(context) { description: post.data.description, pubDate: post.data.pubDate, categories: post.data.tags, - // Generate a `url` from each post `slug` - // This assumes all blog posts are rendered as `/blog/[slug]` routes - // https://docs.astro.build/en/guides/content-collections/#generating-pages-from-content-collections link: `/posts/${post.slug}/`, })), }); diff --git a/src/pages/tags/[...slug].astro b/src/pages/tags/[...slug].astro new file mode 100644 index 0000000..c8eaecb --- /dev/null +++ b/src/pages/tags/[...slug].astro @@ -0,0 +1,15 @@ +--- +import General from '@layouts/General.astro'; +import { getCollection } from 'astro:content'; + +export async function getStaticPaths() { + const blogEntries = await getCollection('blog'); + const tags = new Set(blogEntries.map(entry => entry.data.tags).flat()); + return Array.from(tags, (tag) => ({ params: {slug: tag}, props: {tag}})); +} + +const { tag } = Astro.props; +--- + + { tag } + \ No newline at end of file