Minimal tags page implementation, remove coments from feed.xml.ts

This commit is contained in:
2023-11-27 21:23:10 -06:00
parent c1410f0a0d
commit 48b5be61f8
2 changed files with 15 additions and 3 deletions

View File

@@ -15,9 +15,6 @@ export async function GET(context) {
description: post.data.description, description: post.data.description,
pubDate: post.data.pubDate, pubDate: post.data.pubDate,
categories: post.data.tags, 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}/`, link: `/posts/${post.slug}/`,
})), })),
}); });

View File

@@ -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;
---
<General>
{ tag }
</General>