From ff157c838dca3f8b8fbf7311d924e283f590c4e3 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Wed, 18 Feb 2026 12:23:10 +0100 Subject: [PATCH] feat: guard Eleventy hooks for incremental rebuild mode Skip OG image generation, Pagefind indexing, and WebSub notification during incremental rebuilds. These expensive operations only run on full builds (container restart), not on every content change. --- eleventy.config.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/eleventy.config.js b/eleventy.config.js index 6dcfb53..1e56907 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -582,8 +582,9 @@ export default function (eleventyConfig) { .slice(0, 5); }); - // Generate OpenGraph images for posts without photos - eleventyConfig.on("eleventy.before", () => { + // Generate OpenGraph images for posts without photos (skip on incremental rebuilds) + eleventyConfig.on("eleventy.before", ({ incremental }) => { + if (incremental) return; const contentDir = resolve(__dirname, "content"); const cacheDir = resolve(__dirname, ".cache"); const siteName = process.env.SITE_NAME || "My IndieWeb Blog"; @@ -603,8 +604,9 @@ export default function (eleventyConfig) { } }); - // Pagefind indexing + WebSub hub notification after each build - eleventyConfig.on("eleventy.after", async ({ dir, runMode }) => { + // Pagefind indexing + WebSub hub notification after each build (skip on incremental rebuilds) + eleventyConfig.on("eleventy.after", async ({ dir, runMode, incremental }) => { + if (incremental) return; // Pagefind indexing try { console.log(`[pagefind] Indexing ${dir.output} (${runMode})...`);