feat(automation): auto-sync listings from NN-slug/index.html#36
Merged
Conversation
既存講義 02-setup / 03-claude-md を SEO・GEO 系メタデータに同期し、 02/03 の og:url が旧 GitHub Pages URL を指していた誤りを修正する。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
NN-slug/index.html を真実源として sitemap.xml / llms.txt / index.html / README.md の講義一覧ブロックを自動生成する仕組みを追加。 - scripts/sync_listings.py: <title> / <meta description> / <section> 数を 抽出して各 listing ファイルのマーカー間を再生成する - sync-listings-check.yml: PR で --check を強制 - sync-listings-bot.yml: main へのマージ後 --write して bot コミット - 4 ファイルにマーカー埋め込み、現状の listing を再生成済み - CONTRIBUTING.md / CLAUDE.md / _template/index.html に運用ノート追記 PR #31 で手動同期した同期漏れの再発防止。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
main 取り込み後の各講義 index.html の最終コミット日 (2026-05-19) を sitemap.xml に反映する。
Codex レビュー (PR #36) で出た 6 点を反映: 1. HTML/XML エスケープ: render_sitemap / render_index_html / render_readme_table が title / description / dir_name を生で埋めていたため、`<`, `&`, `"` 等が 入った瞬間に root index.html や sitemap.xml の構造が壊れるリスクがあった。 html.escape() を出力側で適用。読み込み側は html.unescape() で正規化して ダブルエンコードを避ける。 2. Marker injection 対策: title / description に '<!-- listings:auto'、改行、 '|' (markdown table 破壊要因) のいずれかが入っていたら fail させる pre-flight validation (validate_metadata) を追加。 3. README table 破壊対策: 1+2 と同系統。`|` を pre-flight で reject + 角括弧を markdown 側でエスケープ。 4. discover_lectures が NN-slug/index.html 不在を silently skip していたのを SystemExit に変更。壊れた lecture を見逃さない。 5. sync-listings-check.yml に permissions: contents: read を明示。 6. sync-listings-bot.yml の git add -A を 4 ファイル限定に絞り、 concurrency group を追加して push race を防止。
This was referenced May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NN-slug/) を追加するだけでsitemap.xml/llms.txt/index.html/README.mdの講義一覧が自動同期される仕組みを導入NN-slug/index.htmlの<title>と<meta name="description">と<section>数(標準ライブラリ Python で抽出)--checkを強制(sync-listings-check.yml)、main では bot が--writeで自己修復(sync-listings-bot.yml)Related Issue
No-Issue: PR #31 と STRATEGY.md「第1段:正典化+GEO」の同期漏れ恒久対策。先行 PR で手動同期した直後の改善で、独立した issue 化は冗長。
Changes
scripts/sync_listings.py— メインスクリプト(--check/--write、Python 3.x 標準ライブラリのみ)scripts/README.md— 使い方ドキュメント.github/workflows/sync-listings-check.yml— PR 時の verify-only.github/workflows/sync-listings-bot.yml— main 時の auto-commit (github-actions[bot])sitemap.xml/llms.txt/index.html/README.md— マーカー埋め込み、現状の listing を再生成CONTRIBUTING.md/CLAUDE.md/_template/index.html— 自動同期の運用ノートを追記<meta description>をそのまま流用する方針なので、index.htmlとllms.txtの.descは各講義の<meta name="description">全文に置き換わります(既存の手書き短文との差し替え)。README の章テーブルも<title>から抽出した topic 名に揃います。Test plan
python3 scripts/sync_listings.py --checkが pass する(初期同期済み)--checkが exit 1 + diff レポートを出すこと--writeで自動修復され、再度--checkが pass することListings Sync Checkワークフローが green になることを確認Listings Sync BotがNo changesで終了することを確認🤖 Generated with Claude Code