diff --git a/astro.config.mjs b/astro.config.mjs index da431d2..29866e4 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,7 +1,7 @@ import { defineConfig } from 'astro/config'; export default defineConfig({ - site: 'https://clawd.bot', + site: 'https://openclaw.ai', output: 'static', build: { assets: 'assets' diff --git a/package.json b/package.json index 1f804a2..2dd3810 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ ] }, "dependencies": { + "@astrojs/rss": "^4.0.15", "@lucide/astro": "^0.563.0", "@vercel/analytics": "^1.6.1", "@vercel/speed-insights": "^1.3.1", diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 293ebbd..8ef5396 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -26,6 +26,7 @@ const { + diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js new file mode 100644 index 0000000..0f4c5df --- /dev/null +++ b/src/pages/rss.xml.js @@ -0,0 +1,23 @@ +import rss from '@astrojs/rss'; +import { getCollection } from 'astro:content'; + +export async function GET(context) { + const posts = await getCollection('blog', ({ data }) => !data.draft); + + return rss({ + title: 'OpenClaw Blog', + description: 'Updates and news from OpenClaw — The AI that actually does things', + site: context.site, + items: posts + .sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf()) + .map((post) => ({ + title: post.data.title, + description: post.data.description, + pubDate: post.data.date, + link: `/blog/${post.slug}/`, + author: `${post.data.authorHandle}@x.com (${post.data.author})`, + categories: post.data.tags, + })), + customData: `en-us`, + }); +}