oliver-zehentleitner / maity
clean-up: G6 tools and scripts: the project site's sitemap never dates the /docs/ pages (bug)
tsk-tf1b78v9kppz Done An agent
From the clean-up audit tsk-hgnbapyw7hnh (uncovered files, G6: CLI leftovers, public-page leftovers, tools and scripts), read at 9dfd4b65.
Bug, small. The maity.dev sitemap has no <lastmod> for any rendered docs page.
1. site_sitemap.py looks for a source file that does not exist (bug)
- Files: tools/site_sitemap.py:50-63 (
last_modifiedrunsgit log -1 -- <docs>/<page>), :73; .github/workflows/pages.yml:63 (--docs docs); tools/site_docs.py:54-61 (url_for: docs/install/quickstart.md becomes /docs/install/quickstart/, cli/README.md becomes /docs/cli/) and :298 (written to site/docs/<path>/index.html). - What is wrong: for a rendered page the sitemap's page is
docs/install/quickstart/index.html, so the script asks git aboutdocs/docs/install/quickstart/index.html. That path never exists,git logprints nothing, and the page gets no date. Onlyindex.htmlat the site root has a source under docs/ (docs/index.html, the one HTML file there), so it is the only page dated. The test only covers the case without history (tools/test_site_sitemap.py:72). - Proposal: let site_docs.py write the map from page to source file (for example
site/docs/_assets/sources.json, or return it to a shared helper), and let site_sitemap.py use that source (docs/install/quickstart.md, cli/README.md) forgit log. A split page (the API contract) takes its source's date. Add a test in a temporary git repository with one rendered page. - Effort: S. Risk: none (the generated sitemap only gains dates).
2. The docs pages' canonical address is written by hand beside the sitemap's --base (design)
- Files: tools/site_docs.py:292 (
canonical=f"https://maity.dev{page.url}"); tools/site_sitemap.py:88 (--base, default https://maity.dev). - What is wrong: two places name the site's address; a
--baseother than the default gives a sitemap whose URLs disagree with the pages' canonical links. - Proposal: a
--baseon site_docs.py with the same default (or one constant both import), and pages.yml passes neither or both. - Effort: S. Risk: none.
Covered elsewhere
None. Searched: sitemap, site_sitemap, site_docs. The hub's own sitemap (hub/src/maity_hub/routes/seo.py) is a separate implementation for a hub instance and is not affected.
Effort: 2S.