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.
This commit is contained in:
Abdessamad Derraz committed 2026-10-28 00:59:53 +01:00
1 parent 7dde69fd74
commit fd9653cb44
2 files changed
+7 -5

No files matched your search

+5 -3
View File
@@ -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("")
+2 -2
View File
@@ -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: