lewisdale.dev/config/plugins/og-image.js
Lewis Dale 46dfcb0a89
All checks were successful
Build and copy to prod / build-and-copy (push) Successful in 1m46s
Fix some HTML validation errors
2024-03-14 08:03:45 +00:00

18 lines
463 B
JavaScript

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',
},
],
},
generateHTML: (outputUrl) => `<meta property="og:image" content="${outputUrl}">`
});
}