aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYasutake Yohei <yohei@yasutakeyohei.com>2026-07-01 19:02:09 +0900
committerYasutake Yohei <yohei@yasutakeyohei.com>2026-07-01 19:02:09 +0900
commit07a9910fbcfc702c6a1ac0f65242a96e145383b9 (patch)
tree7ed481360a43a0f993c82bd2be63fc678366f7e9
parent2d14a3fe38164cb1066b50f12b78dbcb97279902 (diff)
og-image.ts: 一般質問サブページに共通OG画像を適用
-rw-r--r--src/plugins/og-image.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/og-image.ts b/src/plugins/og-image.ts
index 358d36f..f3534e6 100644
--- a/src/plugins/og-image.ts
+++ b/src/plugins/og-image.ts
@@ -18,6 +18,11 @@ export default function ogImageIntegration(): AstroIntegration {
let html = fs.readFileSync(htmlPath, "utf-8");
let slug = page.pathname.replace(/^\/|\/$/g, "") || "index";
+
+ // 一般質問のサブページは共通のOG画像を使用
+ if (slug.startsWith("ippan-situmon/") && slug !== "ippan-situmon") {
+ slug = "ippan-situmon";
+ }
const ogImageUrl = `https://yasutakeyohei.com/og/${slug}.png?v=2`;
html = html.replace(