fix: pagefind output directory to match template references

Templates reference /pagefind/pagefind-ui.js but pagefind defaulted
to _pagefind/ (with underscore). Added --output-subdir pagefind flag
and updated ignores to match.
This commit is contained in:
Ricardo
2026-02-18 17:31:00 +01:00
parent 2ebe63ffff
commit a0040c949d
2 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View File

@@ -3,7 +3,7 @@ node_modules/
# Build output # Build output
_site/ _site/
_pagefind/ pagefind/
css/style.css css/style.css
# Cache # Cache

View File

@@ -32,16 +32,16 @@ export default function (eleventyConfig) {
eleventyConfig.ignores.add("README.md"); eleventyConfig.ignores.add("README.md");
// Ignore Pagefind output directory // Ignore Pagefind output directory
eleventyConfig.ignores.add("_pagefind"); eleventyConfig.ignores.add("pagefind");
eleventyConfig.ignores.add("_pagefind/**"); eleventyConfig.ignores.add("pagefind/**");
// Configure watch targets to exclude output directory // Configure watch targets to exclude output directory
eleventyConfig.watchIgnores.add("_site"); eleventyConfig.watchIgnores.add("_site");
eleventyConfig.watchIgnores.add("_site/**"); eleventyConfig.watchIgnores.add("_site/**");
eleventyConfig.watchIgnores.add("/app/data/site"); eleventyConfig.watchIgnores.add("/app/data/site");
eleventyConfig.watchIgnores.add("/app/data/site/**"); eleventyConfig.watchIgnores.add("/app/data/site/**");
eleventyConfig.watchIgnores.add("_pagefind"); eleventyConfig.watchIgnores.add("pagefind");
eleventyConfig.watchIgnores.add("_pagefind/**"); eleventyConfig.watchIgnores.add("pagefind/**");
eleventyConfig.watchIgnores.add(".cache/og"); eleventyConfig.watchIgnores.add(".cache/og");
eleventyConfig.watchIgnores.add(".cache/og/**"); eleventyConfig.watchIgnores.add(".cache/og/**");
@@ -621,7 +621,7 @@ export default function (eleventyConfig) {
// Pagefind indexing // Pagefind indexing
try { try {
console.log(`[pagefind] Indexing ${dir.output} (${runMode})...`); console.log(`[pagefind] Indexing ${dir.output} (${runMode})...`);
execFileSync("npx", ["pagefind", "--site", dir.output, "--glob", "**/*.html"], { execFileSync("npx", ["pagefind", "--site", dir.output, "--output-subdir", "pagefind", "--glob", "**/*.html"], {
stdio: "inherit", stdio: "inherit",
timeout: 60000, timeout: 60000,
}); });