mirror of
https://github.com/Xevion/undefined.behavio.rs.git
synced 2025-12-06 05:16:57 -06:00
Add RSS mechnaisms
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/check": "^0.3.1",
|
||||
"@astrojs/rss": "^3.0.0",
|
||||
"@astrojs/sitemap": "^3.0.3",
|
||||
"@astrojs/tailwind": "^5.0.2",
|
||||
"astro": "^3.6.0",
|
||||
|
||||
21
pnpm-lock.yaml
generated
21
pnpm-lock.yaml
generated
@@ -8,6 +8,9 @@ dependencies:
|
||||
'@astrojs/check':
|
||||
specifier: ^0.3.1
|
||||
version: 0.3.1(prettier-plugin-astro@0.12.2)(prettier@3.1.0)(typescript@5.3.2)
|
||||
'@astrojs/rss':
|
||||
specifier: ^3.0.0
|
||||
version: 3.0.0
|
||||
'@astrojs/sitemap':
|
||||
specifier: ^3.0.3
|
||||
version: 3.0.3
|
||||
@@ -150,6 +153,13 @@ packages:
|
||||
prismjs: 1.29.0
|
||||
dev: false
|
||||
|
||||
/@astrojs/rss@3.0.0:
|
||||
resolution: {integrity: sha512-PMX8iqByk9gtOrusikten/oF5uHjOCZigL6RuXFBUu+xtdKQxXzfIohJ99V2haA4FJjVDyibDTGzXR81POBMxQ==}
|
||||
dependencies:
|
||||
fast-xml-parser: 4.3.2
|
||||
kleur: 4.1.5
|
||||
dev: false
|
||||
|
||||
/@astrojs/sitemap@3.0.3:
|
||||
resolution: {integrity: sha512-+GRKp1yho9dpHBcMcU6JpbL41k0yYZghOkNsMRb8QIRflbGHvd787tdv9oIZ5NJj0SqAuOlqp2UpqLkJXuAe2A==}
|
||||
dependencies:
|
||||
@@ -1796,6 +1806,13 @@ packages:
|
||||
micromatch: 4.0.5
|
||||
dev: false
|
||||
|
||||
/fast-xml-parser@4.3.2:
|
||||
resolution: {integrity: sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
strnum: 1.0.5
|
||||
dev: false
|
||||
|
||||
/fastq@1.15.0:
|
||||
resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==}
|
||||
dependencies:
|
||||
@@ -3758,6 +3775,10 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/strnum@1.0.5:
|
||||
resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==}
|
||||
dev: false
|
||||
|
||||
/sucrase@3.34.0:
|
||||
resolution: {integrity: sha512-70/LQEZ07TEcxiU2dz51FKaE6hCTWC6vr7FOk3Gr0U60C3shtAN+H+BFr9XlYe5xqf3RA8nrc+VIwzCfnxuXJw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
24
src/pages/feed.xml.ts
Normal file
24
src/pages/feed.xml.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
// src/pages/rss.xml.js
|
||||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
export async function GET(context) {
|
||||
const posts = await getCollection('blog');
|
||||
return rss({
|
||||
title: 'Undefined Behaviors',
|
||||
description: 'A amateur\'s blog discussing programming, technology, and other things.',
|
||||
// Pull in your project "site" from the endpoint context
|
||||
// https://docs.astro.build/en/reference/api-reference/#contextsite
|
||||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
title: post.data.title,
|
||||
description: post.data.description,
|
||||
pubDate: post.data.pubDate,
|
||||
categories: post.data.tags,
|
||||
// Generate a `url` from each post `slug`
|
||||
// This assumes all blog posts are rendered as `/blog/[slug]` routes
|
||||
// https://docs.astro.build/en/guides/content-collections/#generating-pages-from-content-collections
|
||||
link: `/posts/${post.slug}/`,
|
||||
})),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user