Auto-generate per-post OG images

Renders a 1200x630 social card per post (satori + resvg-js, using the
site's own self-hosted fonts) instead of reusing one generic og-image.png
for every post. Wired into npm run build via a new generate:og step;
templates/page.html falls back to the per-slug image unless extra.image
is set, and non-post pages keep the generic fallback.
This commit is contained in:
2026-08-19 10:56:40 +03:00
parent 6b8b926730
commit a49aa02886
24 changed files with 728 additions and 4 deletions
+5 -1
View File
@@ -2,11 +2,15 @@
"name": "andwati-com",
"private": true,
"devDependencies": {
"@resvg/resvg-js": "^2.6.2",
"satori": "^0.29.0",
"wawoff2": "^2.0.1",
"wrangler": "^4"
},
"scripts": {
"generate:llms": "node scripts/generate-llms.mjs",
"build": "npm run generate:llms && zola build",
"generate:og": "node scripts/generate-og-images.mjs",
"build": "npm run generate:llms && npm run generate:og && zola build",
"deploy": "npm run build && wrangler deploy"
}
}