Adds per-tag RSS link to each tag page.

This commit is contained in:
2026-03-16 11:35:49 -07:00
parent 8f6de2cced
commit 0e4c438869
2 changed files with 9 additions and 1 deletions

View File

@@ -13,6 +13,13 @@ interface Props {
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
const blogTagMatch = Astro.url.pathname.match(/blog\/tag\/(\w+)/);
const rssUrl =
blogTagMatch
? new URL(`blog/tag/${blogTagMatch[1]}.rss.xml`, Astro.site)
: new URL(`rss.xml`, Astro.site);
const { title, description, image } = Astro.props;
---
@@ -25,7 +32,7 @@ const { title, description, image } = Astro.props;
rel="alternate"
type="application/rss+xml"
title={SITE_TITLE}
href={new URL('rss.xml', Astro.site)}
href={rssUrl}
/>
<meta name="generator" content={Astro.generator} />

View File

@@ -14,6 +14,7 @@ const { selectedTag } = Astro.props;
const tags = await getAllTags();
const posts = await getPublishedPosts( selectedTag );
---
<RootLayout>