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 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user