feat: give every Nintendo console its own page

"gba bios" landed on mGBA's page because the Game Boy Advance was a section of the Nintendo page. CONSOLE_PAGES now splits Nintendo as it does Sony: eleven more consoles get a page (Famicom Disk System, Game Boy Advance, Game Boy Color, Nintendo 64, Pokemon Mini, Satellaview, SuFami Turbo, Super Famicom Box, Super Game Boy, Switch, Wii). Each section keeps its heading and anchor on the Nintendo page and leads to the console's page. The search gate expects the Game Boy Advance, Game Boy Color and Wii pages first for their queries.
This commit is contained in:
Abdessamad Derraz committed 2026-11-19 19:58:08 +01:00
1 parent 2d587749a5
commit b4b4ddffb5
7 files changed
+73 -23

No files matched your search

+33 -4
View File
@@ -746,20 +746,49 @@ class SearchConsoleOwnership(unittest.TestCase):
(DIST / "index.html").read_text(encoding="utf-8"))
NINTENDO_CONSOLES = (
"nintendo-3ds", "nintendo-famicom-disk-system", "nintendo-game-boy",
"nintendo-game-boy-advance", "nintendo-game-boy-color", "nintendo-gamecube",
"nintendo-nes", "nintendo-nintendo-64", "nintendo-nintendo-64dd", "nintendo-nintendo-ds",
"nintendo-nintendo-dsi", "nintendo-pokemon-mini", "nintendo-satellaview", "nintendo-snes",
"nintendo-sufami-turbo", "nintendo-super-famicom-box", "nintendo-super-game-boy",
"nintendo-switch", "nintendo-wii", "nintendo-wii-u",
)
class EverySonyConsoleHasItsPage(unittest.TestCase):
"""A section shares its page's search fields: "playstation 3 bios"
found the PlayStation page before the Sony page holding the PS3."""
found the PlayStation page before the Sony page holding the PS3, and
"gba bios" landed on mGBA's page, the Game Boy Advance being a section
of the Nintendo page."""
def test_sony_is_split_by_console(self):
def test_sony_and_nintendo_are_split_by_console(self):
source = script_source("generate_site.py")
self.assertIn('CONSOLE_PAGES = frozenset({"Sony"})', source)
self.assertIn('CONSOLE_PAGES = frozenset({"Nintendo", "Sony"})', source)
self.assertIn("manufacturer in CONSOLE_PAGES", source)
def test_the_game_boy_advance_page_and_its_section(self):
docs = WEBSITE / "src" / "content" / "docs"
page = docs / "systems" / "nintendo-game-boy-advance.mdx"
if not page.is_file():
self.skipTest("site not generated")
text = page.read_text(encoding="utf-8")
self.assertIn("content: Game Boy Advance BIOS files (Nintendo) - RetroBIOS", text)
self.assertIn("/retrobios/emulators/mgba/", text)
# The section keeps its anchor on the Nintendo page and leads here.
summary = (docs / "systems" / "nintendo.md").read_text(encoding="utf-8")
section = summary.split("## Game Boy Advance { #game-boy-advance }", 1)[1]
self.assertIn("(/retrobios/systems/nintendo-game-boy-advance/)",
section.split("\n## ", 1)[0])
mgba = next((docs / "emulators").glob("mgba.md*")).read_text(encoding="utf-8")
self.assertIn("systems/nintendo-game-boy-advance/", mgba)
self.assertNotIn("systems/nintendo/#game-boy-advance", mgba)
@unittest.skipUnless((DIST / "index.html").is_file(), "site not built")
def test_each_console_page_is_built(self):
for slug in ("sony-playstation", "sony-playstation-2", "sony-playstation-3",
"sony-playstation-4", "sony-playstation-portable", "sony-playstation-vita",
"sony-pocketstation"):
"sony-pocketstation", *NINTENDO_CONSOLES):
with self.subTest(page=slug):
self.assertTrue((DIST / "systems" / slug / "index.html").is_file())
+4 -3
View File
@@ -551,11 +551,12 @@ class GateQueries(unittest.TestCase):
"playstation 2 bios": (("systems/sony-playstation-2/",), 1),
"playstation 3 bios": (("systems/sony-playstation-3/",), 2),
"ps3 bios": (("systems/sony-playstation-3/",), 1),
"game boy advance bios": (("systems/nintendo/",), 1),
"game boy color bios": (("systems/nintendo/",), 1),
"game boy advance bios": (("systems/nintendo-game-boy-advance/",), 1),
"game boy color bios": (("systems/nintendo-game-boy-color/",), 1),
"gba bios": (("systems/nintendo-game-boy-advance/",), 3),
"nintendo ds bios": (("systems/nintendo-nintendo-ds/",), 1),
"nintendo dsi bios": (("systems/nintendo-nintendo-dsi/",), 1),
"wii bios": (("systems/nintendo/",), 1),
"wii bios": (("systems/nintendo-wii/",), 1),
"wii u bios": (("systems/nintendo-wii-u/",), 1),
"saturn bios": (("systems/sega-saturn/",), 1),
"check my bios folder": (("wiki/troubleshooting/",), 3),
+4 -2
View File
@@ -150,10 +150,12 @@ class AnIdNamesOneCardPerPage(unittest.TestCase):
def test_the_second_card_has_no_id(self):
from packs.crossref import FileConsumers
# Sega keeps small consoles on its page: Nintendo and Sony give every
# console a page of its own (CONSOLE_PAGES).
entry = {"name": "a.bin", "sha1": "a" * 40, "md5": "b" * 32, "size": 3,
"path": "bios/Nintendo/DS/a.bin"}
"path": "bios/Sega/Mega CD/a.bin"}
page = systempages.generate_system_page(
"Nintendo", {"DS": [entry], "DSi": [entry]}, FileConsumers({"files": {}}))
"Sega", {"Mega CD": [entry], "Mega Drive": [entry]}, FileConsumers({"files": {}}))
self.assertEqual(page.count('id="sha1-aaaaaaaaaaaa" class="rb-file-title"'), 1)
self.assertEqual(page.count("rb-sys-file"), 2)
+7 -1
View File
@@ -621,9 +621,15 @@ class TheBuiltSystemPages(unittest.TestCase):
self.assertNotRegex(opening.casefold(), r"dsi_|bios7i|bios9i")
def test_the_gba_line_prints_the_setups_name(self) -> None:
"""On the Nintendo page, whose section now leads to the console's
own page, and on that page above its first card."""
page = (DIST / "systems" / "nintendo" / "index.html").read_text(encoding="utf-8")
section = page[page.index('id="game-boy-advance"'):page.index('id="game-boy-color"')]
self.assertRegex(section[:section.index("class=\"rb-sys-file\"")], r"<code[^>]*>gba_bios.bin</code>")
own = (DIST / "systems" / "nintendo-game-boy-advance" / "index.html").read_text(
encoding="utf-8")
for opening in (section.split('class="rb-sys-file"')[0],
own.split('class="rb-sys-file"')[0]):
self.assertRegex(opening, r"<code[^>]*>gba_bios.bin</code>")
def test_the_neo_geo_section_opens_on_the_neo_geo_bios(self) -> None:
page = (DIST / "systems" / "snk" / "index.html").read_text(encoding="utf-8")