From fd9653cb443142f057132fe15907876464c71413 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Wed, 28 Oct 2026 00:59:53 +0100 Subject: [PATCH] fix: keep heading levels on console pages On a console's own page the region block came after the title with no section above it, h1 then h3, and validate_site refused the PlayStation and Saturn pages. It is a section there and stays under the console heading on a maker's page. --- scripts/generate_site.py | 8 +++++--- scripts/sitemeasurements.py | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/generate_site.py b/scripts/generate_site.py index a3ad9dfaf..1509f07ee 100644 --- a/scripts/generate_site.py +++ b/scripts/generate_site.py @@ -7180,8 +7180,10 @@ def system_pages( _section_label(manufacturer, console), _install_pairs(installs.get(console, []), lead, consumers)) - def region_block(console: str) -> list[str]: - return sitemeasurements.region_section(_REGION_RESULTS.get((slug, console), [])) + def region_block(console: str, level: int = 3) -> list[str]: + # Under the console's heading on a maker's page, a section of its + # own on the console's page. + return sitemeasurements.region_section(_REGION_RESULTS.get((slug, console), []), level) def all_sections() -> dict[str, list[Card]]: anchors: set[str] = set() @@ -7373,7 +7375,7 @@ def system_pages( lines.extend(_romset_note({console: consoles[console]})) lines.extend(install_block(console)) if index == 0: - lines.extend(region_block(console)) + lines.extend(region_block(console, 2)) lines.extend(["## Files", ""]) lines.extend(_cards_markdown(part)) lines.append("") diff --git a/scripts/sitemeasurements.py b/scripts/sitemeasurements.py index bce1c0fa1..2fb31a85d 100644 --- a/scripts/sitemeasurements.py +++ b/scripts/sitemeasurements.py @@ -409,11 +409,11 @@ VARIANT_WORDS = {"full": "every regional BIOS", "own": "its own region's BIOS on "others": "the other regions' BIOS only", "pack": "the region's pack"} -def region_section(results: list[dict]) -> list[str]: +def region_section(results: list[dict], level: int = 3) -> list[str]: """What the region runs showed for one system, with the records.""" if not results: return [] - lines = ["### Region check", "", + lines = ["#" * level + " Region check", "", f"Each game ran with {VARIANT_WORDS['own']}, then with {VARIANT_WORDS['others']} " f"([method](../{METHOD_PAGE})).", ""] for result in results: