lewisdale.dev/config/plugins/og-image.js
Lewis Dale e0c315d837
Some checks failed
Build and copy to prod / build-and-copy (push) Has been cancelled
Upgrade to Eleventy 3.0.0
2024-10-06 12:36:54 +01:00

18 lines
451 B
JavaScript

import fs from 'node:fs';
import ogImagePlugin from 'eleventy-plugin-og-image';
export default 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}">`
});
}