No updates detected yet. GitHub releases will appear here.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗触って分かるシミュレーター集。静的サイト(HTML/CSS/JS)+ Vercel サーバーレス関数。
シミュラボ/
├── index.html トップ(ランキング・カテゴリ・ギャラリー)
├── sims/<id>/index.html 各シミュレーター(7本)
├── contact/ request/ board/ terms/ privacy/ サブページ
├── assets/ 共通CSS・JS(share-counter.js / vote.js)
├── ogp/ OGP画像(PNG・gen_images.pyで生成)
├── api/ サーバーレス関数(share/vote/request/og)※KV利用
├── sitemap.xml / robots.txt / favicon類
├── scripts/ ビルド用Python(※公開には含めない)
└── package.json api/ の依存(@vercel/kv, @vercel/og)
ローカル確認: python -m http.server 8791 をこのフォルダで実行 → http://localhost:8791/
shimulabo)git init
git add .
git commit -m "シミュラボ 初回公開"
git branch -M main
git remote add origin https://github.com/<あなた>/shimulabo.git
git push -u origin main
https://shimulabo.vercel.app が公開される以降は
git pushするたびに自動で再デプロイされる。
npm i -g vercel
cd シミュラボ
vercel # 初回。質問はだいたいEnterでOK
vercel --prod # 本番反映
shimulabo.com を追加A レコード: @ → Vercelが表示するIP(例: 76.76.21.21)CNAME: www → cname.vercel-dns.comwww付き → なし(またはその逆)の統一リダイレクトもVercelのDomains画面で設定拡散カウント・投票・リクエスト保存を全ユーザー共通にする場合のみ。 やらなくてもサイトは公開・閲覧できる(カウントがブラウザ単位になるだけ)。
KV_REST_API_URL / KV_REST_API_TOKEN が自動で入るassets/share-counter.js … const API = '' → '/api/share'assets/vote.js … const API = '' → '/api/vote'request/index.html のフォーム送信を mailto → fetch('/api/request', …) に変更ADMIN_KEY を設定git push(or vercel --prod)で反映
package.jsonに依存が書いてあるので、Vercelが自動で@vercel/kv等をインストールする。
contact/index.html … const TO = '[email protected]' を実アドレスへrequest/index.html … const TO = '[email protected]' を実アドレスへ(mailto方式。受信用アドレスを用意して差し替えるだけ)
shimulabo.com を登録(DNS認証 or HTMLメタ)https://shimulabo.com/sitemap.xml を送信sims/<新id>/index.html を作成(既存シミュをコピーして中身を差し替えるのが速い)
share-counter.js の initSim({ simId:'<新id>', … }) を入れるindex.html に:ギャラリーカード追加+ランキング SIMS 配列に1行追加scripts/seo_internal.py の SIMS に1行追加 → 下記を実行:
python scripts/gen_images.py # OGP画像を生成(新idぶん)
python scripts/patch_heads.py # favicon/OGPメタを新ページに付与
python scripts/seo_internal.py # 構造化データ・パンくず・関連リンク・sitemap更新
api/share.js api/vote.js の ALLOW セット(許可ID)に新idを追加(KV利用時)git pushスクリプトはすべて冪等(何度実行しても二重挿入されない)。
| スクリプト | 役割 |
|---|---|
gen_images.py | OGP画像(1200x630)・favicon PNG を生成 |
patch_heads.py | 全ページの<head>に favicon・OGP/Twitterメタを挿入 |
seo_internal.py | canonical・JSON-LD・パンくず・関連リンク・sitemap/robots |
set_domain.py | ドメイン文字列を一括置換(例: python scripts/set_domain.py 新ドメイン) |
実行には Python と Pillow(pip install pillow)が必要。
scripts/・アイデア帳.md が公開URLから見えない(.vercelignore で除外済み)contact / request のメール宛先を実アドレスに変更したshare-counter.js vote.js の API を切り替えた