My landing page, written in Astro hayden.moe

fix: drop rss

hayden.moe 240e7c13 f813ab5b

verified
-32
-32
src/pages/rss.xml.ts
··· 1 - import rss from '@astrojs/rss'; 2 - import type { APIContext } from "astro"; 3 - import { getPosts } from '~/atproto/getPosts'; 4 - 5 - export const prerender = false; 6 - 7 - export const GET = async (context: APIContext) => { 8 - const posts = await getPosts(context.locals, undefined); 9 - 10 - const postsFiltered = posts.filter(p => !p.content?.startsWith('NOT_LIVE')); 11 - 12 - const postsShortened = postsFiltered.map(p => { 13 - if (p.content?.length! > 200) { 14 - p.content = p.content?.slice(0, 200).trimEnd() + '...'; 15 - } 16 - return p; 17 - }); 18 - 19 - return rss({ 20 - title: 'Hayden\'s Blog', 21 - description: 'The blog of a lowly DevOps Engineer from the UK. Federated on atproto!', 22 - site: context.site, 23 - 24 - items: postsShortened.map(post => ({ 25 - id: `${context.site}posts/${post.rkey}/`, 26 - title: post.title, 27 - link: `${context.site}posts/${post.rkey}/`, 28 - date: new Date(post.createdAt), 29 - description: post.content, 30 - })), 31 - }); 32 - };