From c66c81c99fdd361b62073e1712903f048f8f6018 Mon Sep 17 00:00:00 2001 From: Joshua Seigler Date: Fri, 4 Jul 2025 10:11:23 -0400 Subject: [PATCH] add links to combined rss feed --- eleventy.config.js | 16 +++++++++------- site/pages/tag.njk | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/eleventy.config.js b/eleventy.config.js index 47e7838..2852e23 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -111,14 +111,16 @@ export default async (config) => { ) }) - config.addCollection("links", fetchShaarliWebroll) + const linksCollection = await fetchShaarliWebroll() + config.addCollection("links", () => linksCollection) - config.addCollection("combinedFeed", (collectionApi) => { - return collectionApi.getAllSorted().filter((item) => { - return (item.data.tags ?? []).some((t) => - ["posts", "recipes", "links"].includes(t) - ) + config.addCollection("combinedFeed", async (collectionApi) => { + const results = collectionApi.getAll().filter((item) => { + return (item.data.tags ?? []).some((t) => { + return ["posts", "recipes"].includes(t) + }) }) + return [...results, ...linksCollection].sort((a, b) => a.date.getTime() - b.date.getTime()) }) config.addFilter("toISOString", (dateString) => { @@ -173,7 +175,7 @@ export default async (config) => { async function fetchShaarliWebroll() { 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) let feedContent if (validation === true) { diff --git a/site/pages/tag.njk b/site/pages/tag.njk index ae3fa3f..30364b1 100644 --- a/site/pages/tag.njk +++ b/site/pages/tag.njk @@ -4,6 +4,7 @@ pagination: data: collections size: 1 alias: tag + addAllPagesToCollections: true filter: - posts - recipes