fix: remove duplicate _ogFileSet/hasOgImage from merge
Build & Deploy / build-and-deploy (push) Successful in 1m27s
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:
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user