fix: remove duplicate _ogFileSet/hasOgImage from merge
Build & Deploy / build-and-deploy (push) Successful in 1m27s

The upstream merge introduced a second hasOgImage implementation
(using a hardcoded .cache/og path) alongside our existing one
(using OG_CACHE_DIR). Removed the duplicate; kept ours.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
svemagie
2026-04-09 14:45:08 +02:00
parent aa571c329d
commit 607e7fecab
-14
View File
@@ -441,20 +441,6 @@ export default function (eleventyConfig) {
} }
}); });
// Cache: directory listing built once per build instead of 3,426 existsSync calls
let _ogFileSet = null;
eleventyConfig.on("eleventy.before", () => { _ogFileSet = null; });
function hasOgImage(ogSlug) {
if (!_ogFileSet) {
const ogDir = resolve(__dirname, ".cache", "og");
try {
_ogFileSet = new Set(readdirSync(ogDir));
} catch {
_ogFileSet = new Set();
}
}
return _ogFileSet.has(`${ogSlug}.png`);
}
eleventyConfig.addTransform("og-fix", function (content, outputPath) { eleventyConfig.addTransform("og-fix", function (content, outputPath) {
if (!outputPath || !outputPath.endsWith(".html")) return content; if (!outputPath || !outputPath.endsWith(".html")) return content;