add links to combined rss feed

This commit is contained in:
Joshua Seigler 2025-07-04 10:11:23 -04:00
parent e5e4dbacf0
commit c66c81c99f
2 changed files with 10 additions and 7 deletions

View file

@ -111,14 +111,16 @@ export default async (config) => {
) )
}) })
config.addCollection("links", fetchShaarliWebroll) const linksCollection = await fetchShaarliWebroll()
config.addCollection("links", () => linksCollection)
config.addCollection("combinedFeed", (collectionApi) => { config.addCollection("combinedFeed", async (collectionApi) => {
return collectionApi.getAllSorted().filter((item) => { const results = collectionApi.getAll().filter((item) => {
return (item.data.tags ?? []).some((t) => return (item.data.tags ?? []).some((t) => {
["posts", "recipes", "links"].includes(t) return ["posts", "recipes"].includes(t)
) })
}) })
return [...results, ...linksCollection].sort((a, b) => a.date.getTime() - b.date.getTime())
}) })
config.addFilter("toISOString", (dateString) => { config.addFilter("toISOString", (dateString) => {
@ -173,7 +175,7 @@ export default async (config) => {
async function fetchShaarliWebroll() { async function fetchShaarliWebroll() {
const url = "https://links.apps.seigler.net/feed/atom?&searchtags=%24webroll" const url = "https://links.apps.seigler.net/feed/atom?&searchtags=%24webroll"
const urlTextContent = await fetch(url, { duration: "30s", type: "text" }) const urlTextContent = await fetch(url, { duration: "0", type: "text" })
const validation = XMLValidator.validate(urlTextContent) const validation = XMLValidator.validate(urlTextContent)
let feedContent let feedContent
if (validation === true) { if (validation === true) {

View file

@ -4,6 +4,7 @@ pagination:
data: collections data: collections
size: 1 size: 1
alias: tag alias: tag
addAllPagesToCollections: true
filter: filter:
- posts - posts
- recipes - recipes