aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pages/og/index.astro
blob: 8bfb7c17d85edd14d94acd3fadf4d415cdb5b862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
import { existsSync, readdirSync } from "node:fs";
import path from "node:path";

const contentDir = "src/content/docs";

function findMdxFiles(dir: string): string[] {
  if (!existsSync(dir)) return [];
  const files: string[] = [];
  for (const entry of readdirSync(dir, { withFileTypes: true })) {
    if (entry.name.startsWith(".") || entry.name.startsWith("_")) continue;
    const full = path.join(dir, entry.name);
    if (entry.isDirectory()) files.push(...findMdxFiles(full));
    else if (entry.name.endsWith(".mdx")) files.push(full);
  }
  return files;
}

const slugs = [
  "index", "jisseki", "policy", "support", "contact",
  "whisper-to-ai-moji-okoshi",
  "koubunsyo-kanri", "ijime-judai-jitai", "fukushi-shisetsu-gyakutai",
  "aiki-kouen", "joutyo-koteikyu", "kajo-seigen-kanwa",
  "saresio-kaihatu", "vaccine-kyuusai-tekiseika", "dislexia-taiou",
  "ippan-situmon",
  // Auto-discover ippan-situmon sub-pages
  ...findMdxFiles(path.join(contentDir, "ippan-situmon"))
    .map((f) =>
      f
        .replace(/\\/g, "/")
        .replace(contentDir + "/", "")
        .replace(/\.mdx$/, "")
        .replace(/\/index$/, "")
        .replace(/\//g, "-")
    )
    .filter((s) => s !== "ippan-situmon"),
];
---

<!DOCTYPE html>
<html lang="ja">
  <head>
    <meta charset="UTF-8" />
    <title>OGP 画像一覧</title>
    <style>
      body {
        font-family: sans-serif;
        max-width: 800px;
        margin: 2rem auto;
        padding: 0 1rem;
        background: #1e293b;
        color: #e2e8f0;
      }
      h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
      .grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1rem;
      }
      .card {
        background: #334155;
        border-radius: 8px;
        padding: 0.75rem;
        text-decoration: none;
        color: #e2e8f0;
        transition: background 0.2s;
      }
      .card:hover { background: #475569; }
      .card img {
        width: 100%;
        border-radius: 4px;
        margin-bottom: 0.5rem;
        border: 1px solid #475569;
      }
      .card span {
        font-size: 0.8rem;
        word-break: break-all;
      }
    </style>
  </head>
  <body>
    <h1>OGP 画像一覧({slugs.length} 枚)</h1>
    <div class="grid">
      {slugs.map((slug) => (
        <a href={`/og/${slug}.png`} class="card">
          <img src={`/og/${slug}.png`} alt={slug} loading="lazy" />
          <span>{slug}.png</span>
        </a>
      ))}
    </div>
  </body>
</html>