Add pre-commit hook to auto-sync News/homepage/bot pages

Versioned hook at tools/git-hooks/pre-commit runs build_listings.py and
build_botlinks.py on every commit and stages their output, so the News hub,
homepage "Latest news", /llms.txt and /links-for-bots/ always reflect the actual
Blog/Projects/News content — no manual step. Non-blocking: warns and proceeds if
Python or a generator fails. Activated with `git config core.hooksPath tools/git-hooks`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
popovskikandClaude Opus 4.8 committed 2026-08-05 18:32:55 +02:00
1 parent cf3fce2522
commit 3eef7a9314
2 files changed
+61

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
# Git hooks
Versioned hooks that keep auto-generated files in sync.
## Activate (once per clone)
```sh
git config core.hooksPath tools/git-hooks
```
That points git at this folder. From then on, every `git commit` runs
`tools/build_listings.py` and `tools/build_botlinks.py` and stages their output,
so the News hub, homepage "Latest news", `/llms.txt` and `/links-for-bots/` stay
in sync with the actual Blog / Projects / News pages.
The hook never blocks a commit — if Python or a generator fails it just prints a
warning and lets the commit proceed.
> Note: SEO metadata and the sitemap are **not** regenerated on commit (that is a
> heavier, all-pages pass). When you add a new page, also add its date to
> `ARTICLE_DATES` in `tools/seo_inject.py` and run
> `python tools/seo_inject.py --all --sitemap`.