diff --git a/_data/blueskyFeed.js b/_data/blueskyFeed.js
index 00e604b..a0229cf 100644
--- a/_data/blueskyFeed.js
+++ b/_data/blueskyFeed.js
@@ -3,7 +3,7 @@
* Fetches recent posts from Bluesky using the AT Protocol API
*/
-import EleventyFetch from "@11ty/eleventy-fetch";
+import { cachedFetch } from "../lib/data-fetch.js";
export default async function () {
const rawHandle = (process.env.BLUESKY_HANDLE || "")
@@ -22,7 +22,7 @@ export default async function () {
// Get the author's feed using public API (no auth needed for public posts)
const feedUrl = `https://public.api.bsky.app/xrpc/app.bsky.feed.getAuthorFeed?actor=${handle}&limit=10`;
- const response = await EleventyFetch(feedUrl, {
+ const response = await cachedFetch(feedUrl, {
duration: "15m", // Cache for 15 minutes
type: "json",
fetchOptions: {
diff --git a/_data/funkwhaleActivity.js b/_data/funkwhaleActivity.js
index 6bc3fc8..779a67e 100644
--- a/_data/funkwhaleActivity.js
+++ b/_data/funkwhaleActivity.js
@@ -3,7 +3,7 @@
* Fetches from Indiekit's endpoint-funkwhale public API
*/
-import EleventyFetch from "@11ty/eleventy-fetch";
+import { cachedFetch } from "../lib/data-fetch.js";
import { cacheCoverUrls, cacheFunkwhaleImage, gcFunkwhaleImages } from "../lib/cache-funkwhale-image.js";
const INDIEKIT_URL =
@@ -27,7 +27,7 @@ async function fetchFromIndiekit(endpoint) {
for (const url of urls) {
try {
console.log(`[funkwhaleActivity] Fetching from Indiekit: ${url}`);
- const data = await EleventyFetch(url, {
+ const data = await cachedFetch(url, {
duration: FUNKWHALE_FETCH_CACHE_DURATION,
type: "json",
});
diff --git a/_data/githubActivity.js b/_data/githubActivity.js
index 49d6036..48a5f95 100644
--- a/_data/githubActivity.js
+++ b/_data/githubActivity.js
@@ -3,7 +3,7 @@
* Fetches commits and repos from self-hosted Gitea instance
*/
-import EleventyFetch from "@11ty/eleventy-fetch";
+import { cachedFetch } from "../lib/data-fetch.js";
const GITEA_URL = process.env.GITEA_INTERNAL_URL || process.env.GITEA_URL || "https://gitea.giersig.eu";
const GITEA_ORG = process.env.GITEA_ORG || "giersig.eu";
diff --git a/_data/githubRepos.js b/_data/githubRepos.js
index ce971f1..712ced1 100644
--- a/_data/githubRepos.js
+++ b/_data/githubRepos.js
@@ -13,7 +13,7 @@ export default async function () {
const url = `${GITEA_URL}/api/v1/orgs/${GITEA_ORG}/repos?limit=10&sort=newest`;
const repos = await cachedFetch(url, {
- duration: "1h",
+ duration: "1h", // Cache for 1 hour
type: "json",
});
diff --git a/_data/githubStarred.js b/_data/githubStarred.js
index ca5cf71..ae45b49 100644
--- a/_data/githubStarred.js
+++ b/_data/githubStarred.js
@@ -6,7 +6,7 @@
* The starred page fetches all data client-side via Alpine.js.
*/
-import EleventyFetch from "@11ty/eleventy-fetch";
+import { cachedFetch } from "../lib/data-fetch.js";
const INDIEKIT_URL = process.env.SITE_URL || "https://example.com";
@@ -19,7 +19,7 @@ export default async function () {
for (const url of urls) {
try {
- const response = await EleventyFetch(url, {
+ const response = await cachedFetch(url, {
duration: "15m",
type: "json",
});
diff --git a/_data/lastfmActivity.js b/_data/lastfmActivity.js
index 7be3ff0..e684f1c 100644
--- a/_data/lastfmActivity.js
+++ b/_data/lastfmActivity.js
@@ -3,7 +3,7 @@
* Fetches from Indiekit's endpoint-lastfm public API
*/
-import EleventyFetch from "@11ty/eleventy-fetch";
+import { cachedFetch } from "../lib/data-fetch.js";
const INDIEKIT_URL =
process.env.INDIEKIT_URL || process.env.SITE_URL || "https://example.com";
@@ -26,7 +26,7 @@ async function fetchFromIndiekit(path) {
for (const url of urls) {
try {
console.log(`[lastfmActivity] Fetching from Indiekit: ${url}`);
- const data = await EleventyFetch(url, {
+ const data = await cachedFetch(url, {
duration: LASTFM_FETCH_CACHE_DURATION,
type: "json",
});
diff --git a/_data/mastodonFeed.js b/_data/mastodonFeed.js
index fc00e5e..0fd9839 100644
--- a/_data/mastodonFeed.js
+++ b/_data/mastodonFeed.js
@@ -3,7 +3,7 @@
* Fetches recent posts from Mastodon using the public API
*/
-import EleventyFetch from "@11ty/eleventy-fetch";
+import { cachedFetch } from "../lib/data-fetch.js";
export default async function () {
const instance = (
@@ -28,7 +28,7 @@ export default async function () {
// First, look up the account ID
const lookupUrl = `https://${instance}/api/v1/accounts/lookup?acct=${username}`;
- const account = await EleventyFetch(lookupUrl, {
+ const account = await cachedFetch(lookupUrl, {
duration: "1h", // Cache account lookup for 1 hour
type: "json",
fetchOptions: {
@@ -46,7 +46,7 @@ export default async function () {
// Fetch recent statuses (excluding replies; boosts included since that's primary activity)
const statusesUrl = `https://${instance}/api/v1/accounts/${account.id}/statuses?limit=10&exclude_replies=true`;
- const statuses = await EleventyFetch(statusesUrl, {
+ const statuses = await cachedFetch(statusesUrl, {
duration: "15m", // Cache for 15 minutes
type: "json",
fetchOptions: {
diff --git a/_includes/components/sections/hero.njk b/_includes/components/sections/hero.njk
index 6da4e7f..54c7e37 100644
--- a/_includes/components/sections/hero.njk
+++ b/_includes/components/sections/hero.njk
@@ -25,8 +25,8 @@
diff --git a/_includes/components/sections/recent-posts.njk b/_includes/components/sections/recent-posts.njk
index 9345659..ba631dd 100644
--- a/_includes/components/sections/recent-posts.njk
+++ b/_includes/components/sections/recent-posts.njk
@@ -7,11 +7,12 @@
{% set sectionConfig = section.config or {} %}
{% set maxItems = sectionConfig.maxItems or 5 %}
{% set showSummary = sectionConfig.showSummary if sectionConfig.showSummary is defined else true %}
+{% set excludeTypes = sectionConfig.excludeTypes or [] %}
{% set primaryPosts = collections.posts if (collections and collections.posts) else [] %}
{% set fallbackRecentPosts = collections.recentPosts if (collections and collections.recentPosts) else [] %}
-{% set listedPosts = primaryPosts | excludeUnlistedPosts %}
+{% set listedPosts = primaryPosts | excludeUnlistedPosts | excludePostTypes(excludeTypes) %}
{% if not (listedPosts and listedPosts.length) %}
- {% set listedPosts = fallbackRecentPosts | excludeUnlistedPosts %}
+ {% set listedPosts = fallbackRecentPosts | excludeUnlistedPosts | excludePostTypes(excludeTypes) %}
{% endif %}
{% if listedPosts and listedPosts.length %}
diff --git a/_includes/components/webmentions.njk b/_includes/components/webmentions.njk
index 752af2e..6a6c310 100644
--- a/_includes/components/webmentions.njk
+++ b/_includes/components/webmentions.njk
@@ -153,9 +153,19 @@