mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-05-15 06:58:50 +02:00
debug: add OG filter debug logging
This commit is contained in:
+6
-1
@@ -343,7 +343,12 @@ export default function (eleventyConfig) {
|
|||||||
// Check if a generated OG image exists for this page slug
|
// Check if a generated OG image exists for this page slug
|
||||||
eleventyConfig.addFilter("hasOgImage", (fileSlug) => {
|
eleventyConfig.addFilter("hasOgImage", (fileSlug) => {
|
||||||
if (!fileSlug) return false;
|
if (!fileSlug) return false;
|
||||||
return existsSync(resolve(__dirname, ".cache", "og", `${fileSlug}.png`));
|
const ogPath = resolve(__dirname, ".cache", "og", `${fileSlug}.png`);
|
||||||
|
const exists = existsSync(ogPath);
|
||||||
|
if (!exists && fileSlug.includes("quand-un-oui")) {
|
||||||
|
console.log(`[og-debug] fileSlug=${fileSlug}, path=${ogPath}, exists=${exists}`);
|
||||||
|
}
|
||||||
|
return exists;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Current timestamp filter (for client-side JS buildtime)
|
// Current timestamp filter (for client-side JS buildtime)
|
||||||
|
|||||||
Reference in New Issue
Block a user