Skip to content

Commit

Permalink
add kb rss auto-discovery links in head
Browse files Browse the repository at this point in the history
  • Loading branch information
activatedgeek committed Dec 8, 2024
1 parent bb90b6f commit be62085
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions astro.config.mjs
Original file line number Diff line number Diff line change
@@ -110,5 +110,6 @@ export default defineConfig({
adapter: cloudflare({
imageService: "passthrough",
}),
trailingSlash: "ignore",
site: `https://${process.env.ASTRO_SITE || "copernicus.local"}`,
});
6 changes: 0 additions & 6 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@ import {
FaHackerNews,
FaLinkedin,
FaStackOverflow,
FaRssSquare,
FaDatabase,
} from "react-icons/fa";
import { FaXTwitter } from "react-icons/fa6";
@@ -136,11 +135,6 @@ const {
<FaDatabase color="#959082" />
</a>
</li>
<li>
<a title="RSS" href="/rss.xml">
<FaRssSquare color="#e26522" />
</a>
</li>
</ul>
</nav>
{
6 changes: 6 additions & 0 deletions src/components/MDPage.astro
Original file line number Diff line number Diff line change
@@ -59,6 +59,12 @@ const { title, description, date, updated, area, comments } = frontmatter;
</style>

<Html frontmatter={frontmatter}>
<link
rel="alternate"
type="application/rss+xml"
href={new URL("kb/rss.xml", Astro.site)}
slot="head"
/>
<main data-pagefind-body>
<section>
<h1 style="--pico-font-size: 2.5rem;">{title}</h1>
1 change: 1 addition & 0 deletions src/pages/rss.xml.ts → src/pages/kb/rss.xml.ts
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ export async function GET({ site }) {
title: `${siteAuthorName}'s Knowledge Base`,
description: `${siteAuthorName}'s Knowledge Base`,
site,
trailingSlash: false,
items: rssItems,
});
}

0 comments on commit be62085

Please sign in to comment.