mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
feat: add RSS feeds for Haiku, AI Art, and Sketchnotes
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
"@astrojs/mdx": "^0.19.4",
|
"@astrojs/mdx": "^0.19.4",
|
||||||
"@astrojs/preact": "^2.2.0",
|
"@astrojs/preact": "^2.2.0",
|
||||||
"@astrojs/prefetch": "^0.2.3",
|
"@astrojs/prefetch": "^0.2.3",
|
||||||
|
"@astrojs/rss": "^2.4.3",
|
||||||
"@astrojs/sitemap": "^1.3.3",
|
"@astrojs/sitemap": "^1.3.3",
|
||||||
"@astrojs/tailwind": "^3.1.3",
|
"@astrojs/tailwind": "^3.1.3",
|
||||||
"astro": "^2.5.5",
|
"astro": "^2.5.5",
|
||||||
|
|||||||
21
pnpm-lock.yaml
generated
21
pnpm-lock.yaml
generated
@@ -21,6 +21,9 @@ dependencies:
|
|||||||
'@astrojs/prefetch':
|
'@astrojs/prefetch':
|
||||||
specifier: ^0.2.3
|
specifier: ^0.2.3
|
||||||
version: 0.2.3
|
version: 0.2.3
|
||||||
|
'@astrojs/rss':
|
||||||
|
specifier: ^2.4.3
|
||||||
|
version: 2.4.3
|
||||||
'@astrojs/sitemap':
|
'@astrojs/sitemap':
|
||||||
specifier: ^1.3.3
|
specifier: ^1.3.3
|
||||||
version: 1.3.3
|
version: 1.3.3
|
||||||
@@ -326,6 +329,13 @@ packages:
|
|||||||
prismjs: 1.29.0
|
prismjs: 1.29.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@astrojs/rss@2.4.3:
|
||||||
|
resolution: {integrity: sha512-Dc8lxsXiDlnxONVIUuc3ohO1+vV1Hp9fRFdUianOola0S9/xv/6FzIHhkQ62MkaFSlcZm5uIOllRWNKVvuFuoA==}
|
||||||
|
dependencies:
|
||||||
|
fast-xml-parser: 4.2.4
|
||||||
|
kleur: 4.1.5
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@astrojs/sitemap@1.3.3:
|
/@astrojs/sitemap@1.3.3:
|
||||||
resolution: {integrity: sha512-TPyyb/hKxc+bHPpSoNPhsuI0QOTVzq2tueg2r0CTH1HqigYIAA2LQkCBlQzz85R+LrOZpv4kXYmhxdDcSkJCmA==}
|
resolution: {integrity: sha512-TPyyb/hKxc+bHPpSoNPhsuI0QOTVzq2tueg2r0CTH1HqigYIAA2LQkCBlQzz85R+LrOZpv4kXYmhxdDcSkJCmA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -7308,6 +7318,13 @@ packages:
|
|||||||
resolution: {integrity: sha512-cIusKBIt/R/oI6z/1nyfe2FvGKVTohVRfvkOhvx0nCEW+xf5NoCXjAHcWp93uOUBchzYcsvPlrapAdX1uW+YGg==}
|
resolution: {integrity: sha512-cIusKBIt/R/oI6z/1nyfe2FvGKVTohVRfvkOhvx0nCEW+xf5NoCXjAHcWp93uOUBchzYcsvPlrapAdX1uW+YGg==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/fast-xml-parser@4.2.4:
|
||||||
|
resolution: {integrity: sha512-fbfMDvgBNIdDJLdLOwacjFAPYt67tr31H9ZhWSm45CDAxvd0I6WTlSOUo7K2P/K5sA5JgMKG64PI3DMcaFdWpQ==}
|
||||||
|
hasBin: true
|
||||||
|
dependencies:
|
||||||
|
strnum: 1.0.5
|
||||||
|
dev: false
|
||||||
|
|
||||||
/fastest-levenshtein@1.0.16:
|
/fastest-levenshtein@1.0.16:
|
||||||
resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==}
|
resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==}
|
||||||
engines: {node: '>= 4.9.1'}
|
engines: {node: '>= 4.9.1'}
|
||||||
@@ -13913,6 +13930,10 @@ packages:
|
|||||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/strnum@1.0.5:
|
||||||
|
resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/strtok3@6.3.0:
|
/strtok3@6.3.0:
|
||||||
resolution: {integrity: sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==}
|
resolution: {integrity: sha512-fZtbhtvI9I48xDSywd/somNqgUHl2L2cstmXCCif0itOf96jeW18MBSyrLuNicYQVkvpOxkZtkzujiTJ9LW5Jw==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|||||||
23
src/pages/rss-ai-art.xml.js
Normal file
23
src/pages/rss-ai-art.xml.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import rss from '@astrojs/rss';
|
||||||
|
import { getCollection } from 'astro:content';
|
||||||
|
|
||||||
|
import { site } from '../data/site';
|
||||||
|
|
||||||
|
export async function get(context) {
|
||||||
|
const aiArt = await getCollection('ai-art');
|
||||||
|
return rss({
|
||||||
|
title: `${site.title} (AI Art)`,
|
||||||
|
description: 'This is a collection of AI art pieces I’ve created with Stable Diffusion.',
|
||||||
|
site: context.site,
|
||||||
|
items: aiArt.map((item) => ({
|
||||||
|
title: item.data.title,
|
||||||
|
pubDate: item.data.date,
|
||||||
|
customData: '<language>en-us</language>',
|
||||||
|
link: `/ai-art/${item.slug}/`,
|
||||||
|
content: `<div>${item.data.images
|
||||||
|
.map((img) => `<img alt="${item.data.title}" src="${img.src}" />`)
|
||||||
|
.join('')}</div>`,
|
||||||
|
})),
|
||||||
|
customData: `<language>en-us</language>`,
|
||||||
|
});
|
||||||
|
}
|
||||||
21
src/pages/rss-haiku.xml.js
Normal file
21
src/pages/rss-haiku.xml.js
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import rss from '@astrojs/rss';
|
||||||
|
import { getCollection } from 'astro:content';
|
||||||
|
|
||||||
|
import { site } from '../data/site';
|
||||||
|
|
||||||
|
export async function get(context) {
|
||||||
|
const haiku = await getCollection('haiku');
|
||||||
|
return rss({
|
||||||
|
title: `${site.title} (Haiku)`,
|
||||||
|
description: 'This is an ever-growing collection of Haiku I have written.',
|
||||||
|
site: context.site,
|
||||||
|
items: haiku.map((item) => ({
|
||||||
|
title: `Haiku ${item.slug}`,
|
||||||
|
pubDate: item.data.date,
|
||||||
|
customData: '<language>en-us</language>',
|
||||||
|
link: `/haiku/${item.slug}/`,
|
||||||
|
content: `<div><p>${item.data.de}</p><hr /><p>${item.data.en}</p></div>`,
|
||||||
|
})),
|
||||||
|
customData: `<language>en-us</language>`,
|
||||||
|
});
|
||||||
|
}
|
||||||
23
src/pages/rss-sketchnotes.xml.js
Normal file
23
src/pages/rss-sketchnotes.xml.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import rss from '@astrojs/rss';
|
||||||
|
import { getCollection } from 'astro:content';
|
||||||
|
|
||||||
|
import { site } from '../data/site';
|
||||||
|
|
||||||
|
export async function get(context) {
|
||||||
|
const sketchnotes = await getCollection('sketchnotes');
|
||||||
|
return rss({
|
||||||
|
title: `${site.title} (Sketchnotes)`,
|
||||||
|
description: 'This is a collection of Sketchnotes I’ve drawn.',
|
||||||
|
site: context.site,
|
||||||
|
items: sketchnotes.map((item) => ({
|
||||||
|
title: item.data.title,
|
||||||
|
pubDate: item.data.date,
|
||||||
|
customData: '<language>en-us</language>',
|
||||||
|
link: `/sketchnotes/${item.slug}/`,
|
||||||
|
content: `<div>${item.data.images
|
||||||
|
.map((img) => `<img alt="${item.data.title}" src="${img.src}" />`)
|
||||||
|
.join('')}</div>`,
|
||||||
|
})),
|
||||||
|
customData: `<language>en-us</language>`,
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user