fix: add an option to disable dynamic OG image generation (#476)

* fix: add an option to disable dynamic OG image generation

Add new `dynamicOgImage` option in the `SITE` object inside 
`src/config.ts` file to disable auto og-image generation during build.

Resolves #428

* docs: update guides for `SITE.dynamicOgImage` option
This commit is contained in:
Sat Naing
2025-03-12 20:47:12 +07:00
committed by GitHub
parent dc5ca47b1d
commit 6749f62015
6 changed files with 70 additions and 29 deletions
+2 -2
View File
@@ -23,14 +23,14 @@ const {
author = SITE.author,
profile = SITE.profile,
description = SITE.desc,
ogImage = SITE.ogImage,
ogImage = SITE.ogImage ? `/${SITE.ogImage}` : "/og.png",
canonicalURL = new URL(Astro.url.pathname, Astro.url),
pubDatetime,
modDatetime,
scrollSmooth = false,
} = Astro.props;
const socialImageURL = new URL(ogImage ?? SITE.ogImage ?? "og.png", Astro.url);
const socialImageURL = new URL(ogImage, Astro.url);
const structuredData = {
"@context": "https://schema.org",