I have a very weird bug : generated folder in _site (my output) is made with backslashes (antislash) but it seems that browser can't render OG image if it the path is not made with /
rather than antislash
:
here is my .eleventy.js plugin config :
const fs = require('node:fs');
const path = require('node:path')
const EleventyPluginOgImage = require('eleventy-plugin-og-image');
module.exports = function(eleventyConfig) {
// AUTO GENERATED OPENGRAPH IMAGES
eleventyConfig.addPlugin(EleventyPluginOgImage, {
outputDir: "_site/og-images",
urlPath: "/og-images/",
satoriOptions: {
fonts: [
{
name: 'Satoshi-Variable',
data: fs.readFileSync('./src/fonts/Satoshi-Variable.woff'),
weight: 500,
style: 'normal',
},
],
},
});
}
my og-image.og.njk is absolute classic and is placed at root (sibling to .eleventy.js, tried putting it in ./src or inner folders but don't change anything) :
<div class="background">
<div class="card">
<h1 class="title">{{ title }}</h1>
</div>
</div>
{% ogImage "og-image.og.njk", { title: title} %}
[11ty] Writing _site\og-images\blog-sq-lite.png from og-image.og.njk
[11ty] Writing _site\og-images\blog.png from og-image.og.njk
and on and on....
tried every config option on the plugin but don't do anything...
<meta property="og:image" content="\og-images\index.png">