From f7ce95107508b30a6a23752ec5e65120c5e830d2 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Sun, 22 Mar 2026 07:43:14 +0100 Subject: [PATCH] fix(listening): copy Funkwhale images in eleventy.after, not passthrough Passthrough copy runs before the data cascade, so .cache/funkwhale-images/ is empty when Eleventy processes it. Moving the copy to eleventy.after guarantees images are downloaded before they're copied to _site/. Co-Authored-By: Claude Sonnet 4.6 --- eleventy.config.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/eleventy.config.js b/eleventy.config.js index f2fd37c..9ba9cd7 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -513,7 +513,7 @@ export default function (eleventyConfig) { eleventyConfig.addPassthroughCopy("robots.txt"); eleventyConfig.addPassthroughCopy("interactive"); eleventyConfig.addPassthroughCopy({ ".cache/og": "og" }); - eleventyConfig.addPassthroughCopy({ ".cache/funkwhale-images": "images/funkwhale-cache" }); + // Funkwhale images are copied in eleventy.after (after data files download them) // Copy vendor web components from node_modules eleventyConfig.addPassthroughCopy({ @@ -1580,6 +1580,21 @@ export default function (eleventyConfig) { } } + // Funkwhale cover images — copy from cache to output after data files have downloaded them + { + const fwSrc = resolve(__dirname, ".cache/funkwhale-images"); + const fwDest = resolve(directories?.output || dir.output, "images/funkwhale-cache"); + if (existsSync(fwSrc)) { + mkdirSync(fwDest, { recursive: true }); + let copied = 0; + for (const file of readdirSync(fwSrc)) { + copyFileSync(resolve(fwSrc, file), resolve(fwDest, file)); + copied++; + } + if (copied > 0) console.log(`[funkwhale-images] Copied ${copied} cover image(s) to output`); + } + } + // Pagefind indexing — run exactly once per process lifetime if (!pagefindDone) { pagefindDone = true;