Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@astrojs/mdx": "^4.3.13",
"@astrojs/react": "^4.4.2",
"@astrojs/rss": "^4.0.18",
"@astrojs/sitemap": "^3.5.1",
"@astrojs/starlight": "^0.37.3",
"aos": "^2.3.4",
Expand Down
6 changes: 6 additions & 0 deletions docs/src/layouts/components/SEO.astro
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ const ogType = article ? "article" : "website";

<!-- Canonical URL -->
<link rel="canonical" href={canonicalUrl} />
<link
rel="alternate"
type="application/rss+xml"
title="RocketSim Blog"
href="/rss.xml"
/>
<link rel="alternate" type="text/plain" title="LLMs" href="/llms.txt" />
<link
rel="alternate"
Expand Down
25 changes: 25 additions & 0 deletions docs/src/pages/rss.xml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";

import config from "@/config/config.json";

export async function GET(context: { site?: URL }) {
const posts = await getCollection("blog");
const site = context.site?.toString() ?? config.site.base_url;

return rss({
title: "RocketSim Blog",
description:
"Tips, guides, and deep dives for iOS developers who want to move faster.",
site,
customData: "<language>en</language>",
items: posts
.map((post) => ({
title: post.data.title,
description: post.data.description,
pubDate: post.data.modifiedTime ?? post.data.publishedTime,
link: `/blog/${post.id}/`,
}))
.sort((a, b) => b.pubDate.getTime() - a.pubDate.getTime()),
});
}
Loading