mirror of
https://github.com/Xevion/undefined.behavio.rs.git
synced 2025-12-16 12:13:44 -06:00
Minimal tags page implementation, remove coments from feed.xml.ts
This commit is contained in:
@@ -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}/`,
|
||||||
})),
|
})),
|
||||||
});
|
});
|
||||||
|
|||||||
15
src/pages/tags/[...slug].astro
Normal file
15
src/pages/tags/[...slug].astro
Normal 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>
|
||||||
Reference in New Issue
Block a user