lewisdale.dev/config/plugins/og-image.js

18 lines
463 B
JavaScript
Raw Normal View History

2024-01-02 12:32:41 +00:00
const ogImagePlugin = require('eleventy-plugin-og-image');
const fs = require('node:fs');
module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(ogImagePlugin, {
satoriOptions: {
fonts: [
{
name: 'Space Grotesk',
data: fs.readFileSync('./src/assets/fonts/SpaceGrotesk-Regular.ttf'),
weight: 500,
style: 'normal',
},
],
},
2024-03-14 08:03:45 +00:00
generateHTML: (outputUrl) => `<meta property="og:image" content="${outputUrl}">`
2024-01-02 12:32:41 +00:00
});
}