Files
hoelee-blog/src/pages/rss.xml.ts
T
hoelee a0b238bc98
Deploy / build (push) Successful in 16s
feat: design-system upgrade + brand to 'Mr Hoelee'
- Extract CSS into src/styles/global.css with design tokens (hoelee.com brand palette)
- Self-hosted Inter + JetBrains Mono via @fontsource
- Sticky nav + manual light/dark toggle + copy-button code blocks
- Author card + Person JSON-LD (E-E-A-T), article meta, related posts, reading time
- Full SEO: canonical, OG (with dims), twitter:card, favicon (all sizes), RSS + sitemap
- New /categories/ and /categories/[category]/ pages
- Add docs/ knowledge guides (content, design, seo, ops) + README index
- Brand name: hoelee.dev -> Mr Hoelee
2026-09-06 06:21:28 +08:00

23 lines
725 B
TypeScript

import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
import { SITE } from '../config';
export async function GET(context) {
const posts = (await getCollection('posts', ({ data }) => !data.draft && data.lang === 'en'))
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
return rss({
title: SITE.name,
description: SITE.description,
site: context.site,
items: posts.map((post) => ({
title: post.data.title,
description: post.data.description,
pubDate: post.data.pubDate,
link: `/posts/${post.slug}/`,
categories: [post.data.category, ...post.data.tags],
})),
customData: `<language>${SITE.locale}</language>`,
});
}