diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-09-19 18:32:19 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-09-19 18:32:19 +0900 |
| commit | cff048210874fc3e55023e83f913ab5abc4a3b10 (patch) | |
| tree | b6c31cca2cc8226f727a66a3729c58dddbea8880 | |
| parent | bc0b0db8fa911f2e0422e6c78d1fc064da446bc6 (diff) | |
[slug].png.ts: iinkaiとmediaのOG画像を生成するよう修正
| -rw-r--r-- | src/pages/og/[slug].png.ts | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/pages/og/[slug].png.ts b/src/pages/og/[slug].png.ts index a743efe..67896d9 100644 --- a/src/pages/og/[slug].png.ts +++ b/src/pages/og/[slug].png.ts @@ -30,6 +30,7 @@ const pages: Record<string, string> = { "vaccine-kyuusai-tekiseika": "ワクチン副反応救済制度の適正化の軌跡", "dislexia-taiou": "ディスレクシア(読み書き障害)対応の軌跡", "ippan-situmon": "一般質問", + media: "メディア掲載", }; function findMdxFiles(dir: string): string[] { @@ -59,14 +60,16 @@ export async function getStaticPaths() { const slugs = new Set<string>(); // Manual pages for (const s of Object.keys(pages)) slugs.add(s); - // Auto-discover ippan-situmon pages - for (const f of findMdxFiles(path.join(contentDir, "ippan-situmon"))) { - const s = f - .replace(/\\/g, "/") - .replace(contentDir + "/", "") - .replace(/\.mdx$/, "") - .replace(/\/index$/, ""); - if (s) slugs.add(s); + // Auto-discover ippan-situmon / iinkai pages + for (const dir of ["ippan-situmon", "iinkai"]) { + for (const f of findMdxFiles(path.join(contentDir, dir))) { + const s = f + .replace(/\\/g, "/") + .replace(contentDir + "/", "") + .replace(/\.mdx$/, "") + .replace(/\/index$/, ""); + if (s) slugs.add(s); + } } return [...slugs] .filter((s) => s.length > 0) |
