Personal Site
fork

Configure Feed

Select the types of activity you want to include in your feed.

Generate an RSS feed from the markdown files.

TODO:
- style it
- add image support (via container api)

vielle.dev af79c245 d0c84354

verified
+59 -8
+1
package.json
··· 11 11 }, 12 12 "dependencies": { 13 13 "@astrojs/node": "^9.3.1", 14 + "@astrojs/rss": "^4.0.12", 14 15 "@astrojs/sitemap": "^3.5.0", 15 16 "@atcute/atproto": "^3.1.1", 16 17 "@atcute/bluesky": "^3.2.0",
+24
pnpm-lock.yaml
··· 16 16 '@astrojs/node': 17 17 specifier: ^9.3.1 18 18 version: 9.3.1(astro@5.12.6(@types/node@24.1.0)(rollup@4.46.2)(typescript@5.8.3)) 19 + '@astrojs/rss': 20 + specifier: ^4.0.12 21 + version: 4.0.12 19 22 '@astrojs/sitemap': 20 23 specifier: ^3.5.0 21 24 version: 3.5.0 ··· 70 73 '@astrojs/prism@3.3.0': 71 74 resolution: {integrity: sha512-q8VwfU/fDZNoDOf+r7jUnMC2//H2l0TuQ6FkGJL8vD8nw/q5KiL3DS1KKBI3QhI9UQhpJ5dc7AtqfbXWuOgLCQ==} 72 75 engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0} 76 + 77 + '@astrojs/rss@4.0.12': 78 + resolution: {integrity: sha512-O5yyxHuDVb6DQ6VLOrbUVFSm+NpObulPxjs6XT9q3tC+RoKbN4HXMZLpv0LvXd1qdAjzVgJ1NFD+zKHJNDXikw==} 73 79 74 80 '@astrojs/sitemap@3.5.0': 75 81 resolution: {integrity: sha512-ldOvoBxuRgpcdndzksskOTzU55g76tkHC/POpejUbPGz6zR4rJKiXh8thX4WEPWDhCTZUafhJ1qf7k1muStHfg==} ··· 825 831 fast-deep-equal@3.1.3: 826 832 resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} 827 833 834 + fast-xml-parser@5.2.5: 835 + resolution: {integrity: sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==} 836 + hasBin: true 837 + 828 838 fdir@6.4.6: 829 839 resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==} 830 840 peerDependencies: ··· 1367 1377 resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} 1368 1378 engines: {node: '>=12'} 1369 1379 1380 + strnum@2.1.1: 1381 + resolution: {integrity: sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==} 1382 + 1370 1383 suf-log@2.5.3: 1371 1384 resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==} 1372 1385 ··· 1683 1696 '@astrojs/prism@3.3.0': 1684 1697 dependencies: 1685 1698 prismjs: 1.30.0 1699 + 1700 + '@astrojs/rss@4.0.12': 1701 + dependencies: 1702 + fast-xml-parser: 5.2.5 1703 + kleur: 4.1.5 1686 1704 1687 1705 '@astrojs/sitemap@3.5.0': 1688 1706 dependencies: ··· 2389 2407 2390 2408 fast-deep-equal@3.1.3: {} 2391 2409 2410 + fast-xml-parser@5.2.5: 2411 + dependencies: 2412 + strnum: 2.1.1 2413 + 2392 2414 fdir@6.4.6(picomatch@4.0.3): 2393 2415 optionalDependencies: 2394 2416 picomatch: 4.0.3 ··· 3254 3276 strip-ansi@7.1.0: 3255 3277 dependencies: 3256 3278 ansi-regex: 6.1.0 3279 + 3280 + strnum@2.1.1: {} 3257 3281 3258 3282 suf-log@2.5.3: 3259 3283 dependencies:
+7 -1
src/components/Base.astro
··· 23 23 <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> 24 24 <meta name="viewport" content="width=device-width" /> 25 25 <link rel="sitemap" href="/sitemap-index.xml" /> 26 - 26 + <link 27 + rel="alternate" 28 + type="application/rss+xml" 29 + title="Your Site's Title" 30 + href={new URL("rss.xml", Astro.site)} 31 + /> 32 + 27 33 <title> 28 34 {title} 29 35 </title>
+27 -7
src/pages/rss.xml.ts
··· 1 - export function GET( 2 - { 3 - // params, request 4 - }, 5 - ) { 6 - return new Response(`RSS Feed!`); 7 - } 1 + import { getCollection } from "astro:content"; 2 + import rss from "@astrojs/rss"; 3 + import type { APIRoute } from "astro"; 4 + 5 + export const GET: APIRoute = async ({ site }) => { 6 + const posts = await getCollection("blog"); 7 + 8 + return rss({ 9 + title: "vielle.dev", 10 + description: "Posts from vielle.dev", 11 + site: site?.toString() ?? "", 12 + items: await Promise.all( 13 + posts.map(async (post) => { 14 + const content = "TODO"; 15 + 16 + return { 17 + title: post.data.title, 18 + description: post.data.bio, 19 + pubDate: post.data.pub, 20 + link: `/blog/${post.id}/`, 21 + content: content, 22 + }; 23 + }), 24 + ), 25 + // stylesheet: ``, 26 + }); 27 + };