From 010e4e5250c6629e31ffd2716ac558e127e163d8 Mon Sep 17 00:00:00 2001 From: Jan Palma Date: Sat, 28 Feb 2026 16:24:59 +0100 Subject: OG Image + Fonts --- eleventy.config.mjs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'eleventy.config.mjs') diff --git a/eleventy.config.mjs b/eleventy.config.mjs index 2e679a3..d81c29a 100644 --- a/eleventy.config.mjs +++ b/eleventy.config.mjs @@ -1,7 +1,8 @@ import { parseISO , format} from "date-fns"; import { config as siteConfig } from "./siteconfig.mjs"; import { eleventyImageTransformPlugin } from "@11ty/eleventy-img"; - +import EleventyPluginOgImage from 'eleventy-plugin-og-image'; +import fs from "fs" export default function(eleventyConfig) { // Order matters, put this at the top of your configuration file. @@ -18,6 +19,25 @@ export default function(eleventyConfig) { }); }); + eleventyConfig.addPlugin(EleventyPluginOgImage, { + satoriOptions: { + fonts: [ + { + name: 'JetBrains Mono', + data: fs.readFileSync('./assets/fonts/JetBrains/OG-Regular.ttf'), + weight: 400, + style: 'normal', + }, + { + name: 'JetBrains Mono', + data: fs.readFileSync('./assets/fonts/JetBrains/OG-Bold.ttf'), + weight: 800, + style: 'normal', + }, + ], + }, + }); + eleventyConfig.addPlugin(eleventyImageTransformPlugin, { widths: [200, "auto"], htmlOptions: { -- cgit v1.3-7-ge9ab