From 7f26821c456f38241f4fe25c43056ec487d229be Mon Sep 17 00:00:00 2001 From: Matthew Watt Date: Mon, 3 Nov 2025 16:43:36 -0600 Subject: [PATCH] Implement rss feed for amplifying-fsharp.github.io --- bun.lock | 11 +++++++++-- package.json | 1 + src/layouts/Layout.astro | 6 ++++++ src/pages/rss.xml.js | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 src/pages/rss.xml.js diff --git a/bun.lock b/bun.lock index a5e7e4a..9103705 100644 --- a/bun.lock +++ b/bun.lock @@ -5,6 +5,7 @@ "name": "amplifying-fsharp-website", "dependencies": { "@astrojs/react": "^4.2.7", + "@astrojs/rss": "^4.0.13", "@iconify-json/bi": "^1.2.4", "@iconify-json/cil": "^1.2.2", "@iconify-json/fluent": "^1.2.21", @@ -34,8 +35,8 @@ "styled-components": "^6.1.18", }, "devDependencies": { - "@mermaid-js/mermaid-cli": "^11.4.0", - "prettier": "^3.4.2", + "@mermaid-js/mermaid-cli": "^11.4.2", + "prettier": "^3.5.3", "prettier-plugin-astro": "^0.14.1", "vite-plugin-fable": "^0.0.32", }, @@ -65,6 +66,8 @@ "@astrojs/react": ["@astrojs/react@4.2.7", "", { "dependencies": { "@vitejs/plugin-react": "^4.4.1", "ultrahtml": "^1.6.0", "vite": "^6.3.4" }, "peerDependencies": { "@types/react": "^17.0.50 || ^18.0.21 || ^19.0.0", "@types/react-dom": "^17.0.17 || ^18.0.6 || ^19.0.0", "react": "^17.0.2 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.2 || ^18.0.0 || ^19.0.0" } }, "sha512-/wM90noT/6QyJEOGdDmDbq2D9qZooKTJNG1M8olmsW5ns6bJ7uxG5fzkYxcpA3WUTD6Dj6NtpEqchvb5h8Fa+g=="], + "@astrojs/rss": ["@astrojs/rss@4.0.13", "", { "dependencies": { "fast-xml-parser": "^5.3.0", "picocolors": "^1.1.1" } }, "sha512-ugW4DmGn8kgfl8/qecU3EcKCAuEBrZqY7eYfa6at0sY7HGEwRdzsOafLE437RwDMP2ZuxfKnCNABs99YVhX0kg=="], + "@astrojs/telemetry": ["@astrojs/telemetry@3.2.1", "", { "dependencies": { "ci-info": "^4.2.0", "debug": "^4.4.0", "dlv": "^1.1.3", "dset": "^3.1.4", "is-docker": "^3.0.0", "is-wsl": "^3.1.0", "which-pm-runs": "^1.1.0" } }, "sha512-SSVM820Jqc6wjsn7qYfV9qfeQvePtVc1nSofhyap7l0/iakUKywj3hfy3UJAOV4sGV4Q/u450RD4AaCaFvNPlg=="], "@babel/code-frame": ["@babel/code-frame@7.26.2", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" } }, "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ=="], @@ -891,6 +894,8 @@ "fast-safe-stringify": ["fast-safe-stringify@2.1.1", "", {}, "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="], + "fast-xml-parser": ["fast-xml-parser@5.3.1", "", { "dependencies": { "strnum": "^2.1.0" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-jbNkWiv2Ec1A7wuuxk0br0d0aTMUtQ4IkL+l/i1r9PRf6pLXjDgsBsWwO+UyczmQlnehi4Tbc8/KIvxGQe+I/A=="], + "fastq": ["fastq@1.19.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ=="], "fd-slicer": ["fd-slicer@1.1.0", "", { "dependencies": { "pend": "~1.2.0" } }, "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g=="], @@ -1587,6 +1592,8 @@ "strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], + "strnum": ["strnum@2.1.1", "", {}, "sha512-7ZvoFTiCnGxBtDqJ//Cu6fWtZtc7Y3x+QOirG15wztbdngGSkht27o2pyGWrVy0b4WAy3jbKmnoK6g5VlVNUUw=="], + "styled-components": ["styled-components@6.1.18", "", { "dependencies": { "@emotion/is-prop-valid": "1.2.2", "@emotion/unitless": "0.8.1", "@types/stylis": "4.2.5", "css-to-react-native": "3.2.0", "csstype": "3.1.3", "postcss": "8.4.49", "shallowequal": "1.1.0", "stylis": "4.3.2", "tslib": "2.6.2" }, "peerDependencies": { "react": ">= 16.8.0", "react-dom": ">= 16.8.0" } }, "sha512-Mvf3gJFzZCkhjY2Y/Fx9z1m3dxbza0uI9H1CbNZm/jSHCojzJhQ0R7bByrlFJINnMzz/gPulpoFFGymNwrsMcw=="], "stylis": ["stylis@4.3.4", "", {}, "sha512-osIBl6BGUmSfDkyH2mB7EFvCJntXDrLhKjHTRj/rK6xLH0yuPrHULDRQzKokSOD4VoorhtKpfcfW1GAntu8now=="], diff --git a/package.json b/package.json index 7b0cc4b..2f99896 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ }, "dependencies": { "@astrojs/react": "^4.2.7", + "@astrojs/rss": "^4.0.13", "@iconify-json/bi": "^1.2.4", "@iconify-json/cil": "^1.2.2", "@iconify-json/fluent": "^1.2.21", diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 5e744f2..c7306a4 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -33,6 +33,12 @@ import Navigation from "../components/Navigation.astro"; {title} | Amplifying F# + ({ + title: post.data.title, + pubDate: post.data.date, + description: `A blog post by ${post.data.author}`, + author: post.data.author, + link: `/blog/${post.id}`, + categories: ["Blog"], + })); + + const sessionItems = sessions.map((session) => ({ + title: session.data.title, + pubDate: session.data.date, + description: `${session.data.preview} - Champion: ${session.data.champion}`, + author: session.data.champion, + link: `/sessions/${session.id}`, + categories: ["Session"], + })); + + const allItems = [...blogItems, ...sessionItems].sort( + (a, b) => b.pubDate - a.pubDate, + ); + + return rss({ + title: "Amplifying F#", + description: "Blog posts and sessions from the Amplifying F# community", + site: context.site, + items: allItems, + customData: `en-us`, + }); +}