From a71f69e0f19a5536d16975a28ec67bf592fcb951 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 28 Jun 2025 22:48:54 -0700 Subject: [PATCH 1/2] Claude made me an RSS feed. https://quic.video/rss.xml --- astro.config.ts | 1 + package.json | 1 + pnpm-lock.yaml | 24 ++++++++++++++++++++++++ src/layouts/global.astro | 1 + src/pages/rss.xml.js | 30 ++++++++++++++++++++++++++++++ 5 files changed, 57 insertions(+) create mode 100644 src/pages/rss.xml.js diff --git a/astro.config.ts b/astro.config.ts index 7dc17c1..847ad6e 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -10,6 +10,7 @@ import mkcert from "vite-plugin-mkcert"; // https://astro.build/config export default defineConfig({ + site: "https://quic.video", integrations: [ mdx(), solidJs(), diff --git a/package.json b/package.json index c518e3c..07db7ef 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dependencies": { "@astrojs/mdx": "4.3.0", "@astrojs/node": "9.2.2", + "@astrojs/rss": "^4.0.12", "@astrojs/solid-js": "5.1.0", "@astrojs/tailwind": "6.0.2", "@kixelated/hang": "^0.2.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e1c3434..2ac0025 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: '@astrojs/node': specifier: 9.2.2 version: 9.2.2(astro@5.8.2(@types/node@22.15.29)(jiti@1.21.7)(rollup@4.41.1)(typescript@5.8.3)(yaml@2.8.0)) + '@astrojs/rss': + specifier: ^4.0.12 + version: 4.0.12 '@astrojs/solid-js': specifier: 5.1.0 version: 5.1.0(@types/node@22.15.29)(jiti@1.21.7)(solid-js@1.9.7)(yaml@2.8.0) @@ -92,6 +95,9 @@ packages: resolution: {integrity: sha512-q8VwfU/fDZNoDOf+r7jUnMC2//H2l0TuQ6FkGJL8vD8nw/q5KiL3DS1KKBI3QhI9UQhpJ5dc7AtqfbXWuOgLCQ==} engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0} + '@astrojs/rss@4.0.12': + resolution: {integrity: sha512-O5yyxHuDVb6DQ6VLOrbUVFSm+NpObulPxjs6XT9q3tC+RoKbN4HXMZLpv0LvXd1qdAjzVgJ1NFD+zKHJNDXikw==} + '@astrojs/solid-js@5.1.0': resolution: {integrity: sha512-VmPHOU9k7m6HHCT2Y1mNzifilUnttlowBM36frGcfj5wERJE9Ci0QtWJbzdf6AlcoIirb7xVw+ByupU011Di9w==} engines: {node: 18.20.8 || ^20.3.0 || >=22.0.0} @@ -1184,6 +1190,10 @@ packages: resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} engines: {node: '>=8.6.0'} + fast-xml-parser@5.2.5: + resolution: {integrity: sha512-pfX9uG9Ki0yekDHx2SiuRIyFdyAr1kMIMitPvb0YBo8SUfKvia7w7FIyd/l6av85pFYRhZscS75MwMnbvY+hcQ==} + hasBin: true + fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} @@ -2119,6 +2129,9 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} + strnum@2.1.1: + resolution: {integrity: sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw==} + style-to-js@1.1.16: resolution: {integrity: sha512-/Q6ld50hKYPH3d/r6nr117TZkHR0w0kGGIVfpG9N6D8NymRPM9RqCUv4pRpJ62E5DqOYx2AFpbZMyCPnjQCnOw==} @@ -2567,6 +2580,11 @@ snapshots: dependencies: prismjs: 1.30.0 + '@astrojs/rss@4.0.12': + dependencies: + fast-xml-parser: 5.2.5 + kleur: 4.1.5 + '@astrojs/solid-js@5.1.0(@types/node@22.15.29)(jiti@1.21.7)(solid-js@1.9.7)(yaml@2.8.0)': dependencies: solid-js: 1.9.7 @@ -3702,6 +3720,10 @@ snapshots: merge2: 1.4.1 micromatch: 4.0.8 + fast-xml-parser@5.2.5: + dependencies: + strnum: 2.1.1 + fastq@1.19.1: dependencies: reusify: 1.1.0 @@ -5076,6 +5098,8 @@ snapshots: dependencies: ansi-regex: 6.1.0 + strnum@2.1.1: {} + style-to-js@1.1.16: dependencies: style-to-object: 1.0.8 diff --git a/src/layouts/global.astro b/src/layouts/global.astro index a5b04eb..5ad7ff8 100644 --- a/src/layouts/global.astro +++ b/src/layouts/global.astro @@ -25,6 +25,7 @@ if (frontmatter?.description) description = frontmatter.description; + {title ? `${title} - Media over QUIC` : "Media over QUIC"} diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js new file mode 100644 index 0000000..2391ad9 --- /dev/null +++ b/src/pages/rss.xml.js @@ -0,0 +1,30 @@ +import rss from "@astrojs/rss"; + +export async function GET(context) { + // Get all blog posts + const posts = await import.meta.glob("./blog/*.{md,mdx}", { eager: true }); + + // Convert to array and sort by date (newest first) + const sortedPosts = Object.values(posts) + .filter((post) => post.frontmatter) // Ensure frontmatter exists + .sort((a, b) => { + const dateA = new Date(a.frontmatter.date); + const dateB = new Date(b.frontmatter.date); + return dateB - dateA; // Newest first + }) + .map((post) => ({ + title: post.frontmatter.title, + description: post.frontmatter.description, + author: post.frontmatter.author, + pubDate: new Date(post.frontmatter.date), + link: post.url, + })); + + return rss({ + title: "quic.video | Blog", + description: "Latest posts about Media over QUIC and real-time media streaming", + site: context.site, + items: sortedPosts, + customData: "en-us", + }); +} From 1f703bdaf82503749de84ff416b9536a4a98bd3f Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 28 Jun 2025 22:54:51 -0700 Subject: [PATCH 2/2] And an icon. --- public/layout/rss.svg | 116 +++++++++++++++++++++++++++++++++++++ src/pages/blog/index.astro | 17 +++++- 2 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 public/layout/rss.svg diff --git a/public/layout/rss.svg b/public/layout/rss.svg new file mode 100644 index 0000000..4e53785 --- /dev/null +++ b/public/layout/rss.svg @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index b757881..8f790fa 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -20,7 +20,22 @@ posts.sort((a, b) => {
-

Blog Posts

+ { posts.map((post) => (