feat: add RSS feed integration for blog
Add official @astrojs/rss integration to enable RSS feed subscription: - Install @astrojs/rss package - Create RSS endpoint at /rss.xml with blog posts - Add RSS autodiscovery meta tag in Layout - Update site URL from clawd.bot to openclaw.ai in config RSS feed includes post titles, descriptions, dates, authors, and categories. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
cf24ff3135
commit
ec98744e47
@ -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'
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -26,6 +26,7 @@ const {
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" />
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
||||
<link rel="canonical" href={canonicalUrl} />
|
||||
<link rel="alternate" type="application/rss+xml" title="OpenClaw Blog" href="/rss.xml" />
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:title" content={title} />
|
||||
|
||||
23
src/pages/rss.xml.js
Normal file
23
src/pages/rss.xml.js
Normal file
@ -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: `<language>en-us</language>`,
|
||||
});
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user