Rewrite tools/build_listings.py to treat the Blog, Projects and News detail pages as the single source of truth. It now regenerates: - the News hub grid (all items, newest first, correct dates from ARTICLE_DATES) - the homepage "Latest news" block (top 3) both marker-wrapped. Previously the News hub was hand-maintained with drifted, hardcoded dates and only some blog posts; now adding a blog/event and running the script flows through to News and the homepage automatically. Card links/images are root-relative so they work on any host. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| README.md | ||
| build_blog.py | ||
| build_botlinks.py | ||
| build_listings.py | ||
| build_search_index.py | ||
| seo_inject.py | ||
README.md
tools/
seo_inject.py
Injects a technical-SEO block into every language page (en|mk|si/**/index.html)
and regenerates sitemap.xml + robots.txt. Safe to re-run — the block lives
between <!-- SEO:START --> and <!-- SEO:END --> and is replaced in place.
The block adds: meta description (auto-extracted from the page's lead/subtitle
where available), canonical, hreflang alternates (en / mk / sl / x-default),
Open Graph, Twitter Card, and an Organization JSON-LD.
All absolute URLs point at the final domain https://msosorg.com (not the
temporary host), so nothing needs rewriting at launch. Note: the Slovene folder
is /si/ but the ISO code is sl — the script maps si → sl for hreflang/locale.
Usage
python tools/seo_inject.py # dry run: print the block for pilot pages
python tools/seo_inject.py --all # write the block into every page
python tools/seo_inject.py --all --sitemap # also rebuild sitemap.xml + robots.txt
Run --all --sitemap after adding, renaming, or deleting any page so canonical
tags, hreflang alternates, and the sitemap stay in sync.