fix: ignore the rendered timestamp when comparing

Decorated site pages carry the generation stamp twice: once as the
markdown footer and once as a rendered element. write_if_changed knew
only the first, so every page was rewritten on every run for the clock
alone.

The comparison is what makes the deploy-site freshness guard a real
staleness check rather than a guaranteed failure, and it had no tests.
This commit is contained in:
Abdessamad Derraz committed 2026-08-11 05:23:52 +02:00
1 parent c562459567
commit cc24ff1bea
2 files changed
+67

No files matched your search

+3
View File
@@ -1368,6 +1368,9 @@ _TIMESTAMP_PATTERNS = [
re.compile(r'"imported_at":\s*"[^"]*"'), # provenance snapshots
re.compile(r"\*Auto-generated on [^*]*\*"), # README.md
re.compile(r"\*Generated on [^*]*\*"), # docs site pages
# The decorated pages carry the same stamp again as a rendered element,
# and missing it rewrote every page on every run for the clock alone.
re.compile(r'<div class="rb-timestamp">[^<]*</div>'),
]