Adding RSS support

This commit is contained in:
Timothy Rogers 2025-02-09 10:36:10 -05:00
parent ecd697c489
commit 6773a5be12
4 changed files with 45 additions and 1 deletions

View file

@ -11,6 +11,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/check": "^0.9.4", "@astrojs/check": "^0.9.4",
"@astrojs/rss": "^4.0.11",
"@astrojs/tailwind": "^6.0.0", "@astrojs/tailwind": "^6.0.0",
"@tailwindcss/typography": "^0.5.16", "@tailwindcss/typography": "^0.5.16",
"astro": "^5.2.3", "astro": "^5.2.3",

24
pnpm-lock.yaml generated
View file

@ -11,6 +11,9 @@ importers:
'@astrojs/check': '@astrojs/check':
specifier: ^0.9.4 specifier: ^0.9.4
version: 0.9.4(typescript@5.6.2) version: 0.9.4(typescript@5.6.2)
'@astrojs/rss':
specifier: ^4.0.11
version: 4.0.11
'@astrojs/tailwind': '@astrojs/tailwind':
specifier: ^6.0.0 specifier: ^6.0.0
version: 6.0.0(astro@5.2.3(jiti@1.21.6)(rollup@4.24.0)(typescript@5.6.2)(yaml@2.5.1))(tailwindcss@3.4.13) version: 6.0.0(astro@5.2.3(jiti@1.21.6)(rollup@4.24.0)(typescript@5.6.2)(yaml@2.5.1))(tailwindcss@3.4.13)
@ -67,6 +70,9 @@ packages:
resolution: {integrity: sha512-GilTHKGCW6HMq7y3BUv9Ac7GMe/MO9gi9GW62GzKtth0SwukCu/qp2wLiGpEujhY+VVhaG9v7kv/5vFzvf4NYw==} resolution: {integrity: sha512-GilTHKGCW6HMq7y3BUv9Ac7GMe/MO9gi9GW62GzKtth0SwukCu/qp2wLiGpEujhY+VVhaG9v7kv/5vFzvf4NYw==}
engines: {node: ^18.17.1 || ^20.3.0 || >=22.0.0} engines: {node: ^18.17.1 || ^20.3.0 || >=22.0.0}
'@astrojs/rss@4.0.11':
resolution: {integrity: sha512-3e3H8i6kc97KGnn9iaZBJpIkdoQi8MmR5zH5R+dWsfCM44lLTszOqy1OBfGGxDt56mpQkYVtZJWoxMyWuUZBfw==}
'@astrojs/tailwind@6.0.0': '@astrojs/tailwind@6.0.0':
resolution: {integrity: sha512-GbEK2/h0nvY8i6g1GZT5ddHAgj71lQIf34/j7+jPLhUti3xDxKcWElApDe2jWvqAaKl2oKEh045ITSm8mU9BVQ==} resolution: {integrity: sha512-GbEK2/h0nvY8i6g1GZT5ddHAgj71lQIf34/j7+jPLhUti3xDxKcWElApDe2jWvqAaKl2oKEh045ITSm8mU9BVQ==}
peerDependencies: peerDependencies:
@ -903,6 +909,10 @@ packages:
fast-uri@3.0.2: fast-uri@3.0.2:
resolution: {integrity: sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row==} resolution: {integrity: sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row==}
fast-xml-parser@4.5.1:
resolution: {integrity: sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w==}
hasBin: true
fastq@1.17.1: fastq@1.17.1:
resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==}
@ -1678,6 +1688,9 @@ packages:
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
engines: {node: '>=4'} engines: {node: '>=4'}
strnum@1.0.5:
resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==}
sucrase@3.35.0: sucrase@3.35.0:
resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==}
engines: {node: '>=16 || 14 >=14.17'} engines: {node: '>=16 || 14 >=14.17'}
@ -2183,6 +2196,11 @@ snapshots:
dependencies: dependencies:
prismjs: 1.29.0 prismjs: 1.29.0
'@astrojs/rss@4.0.11':
dependencies:
fast-xml-parser: 4.5.1
kleur: 4.1.5
'@astrojs/tailwind@6.0.0(astro@5.2.3(jiti@1.21.6)(rollup@4.24.0)(typescript@5.6.2)(yaml@2.5.1))(tailwindcss@3.4.13)': '@astrojs/tailwind@6.0.0(astro@5.2.3(jiti@1.21.6)(rollup@4.24.0)(typescript@5.6.2)(yaml@2.5.1))(tailwindcss@3.4.13)':
dependencies: dependencies:
astro: 5.2.3(jiti@1.21.6)(rollup@4.24.0)(typescript@5.6.2)(yaml@2.5.1) astro: 5.2.3(jiti@1.21.6)(rollup@4.24.0)(typescript@5.6.2)(yaml@2.5.1)
@ -3012,6 +3030,10 @@ snapshots:
fast-uri@3.0.2: {} fast-uri@3.0.2: {}
fast-xml-parser@4.5.1:
dependencies:
strnum: 1.0.5
fastq@1.17.1: fastq@1.17.1:
dependencies: dependencies:
reusify: 1.0.4 reusify: 1.0.4
@ -4065,6 +4087,8 @@ snapshots:
strip-bom@3.0.0: {} strip-bom@3.0.0: {}
strnum@1.0.5: {}
sucrase@3.35.0: sucrase@3.35.0:
dependencies: dependencies:
'@jridgewell/gen-mapping': 0.3.5 '@jridgewell/gen-mapping': 0.3.5

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 744 KiB

Before After
Before After

19
src/pages/blog/rss.xml.js Normal file
View file

@ -0,0 +1,19 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
export async function GET(context) {
const Blog = await getCollection("blog");
return rss({
title: "Hack13 Ramblings",
description: "A fox with a blog, that rambles about tech, games, and life.",
site: "https://hack13.me",
feed_url: "https://hack13.me/blog/rss.xml",
image_url: "https://hack13.me/favicon.png",
items: Blog.map((post) => ({
title: post.data.title,
pubDate: post.data.published,
description: post.data.description,
link: `https://hack13.me/blog/${post.slug}`,
})),
});
}