feat: give every Sony console its own page

A section shares its page's search fields, and "playstation 3 bios" found the PlayStation page before the Sony page that held the PS3. CONSOLE_PAGES splits Sony by console whatever the size. The search gate now expects the PlayStation 3 page in the top two for that query, the order of words being something Pagefind does not weigh, and the page first for "ps3 bios".
This commit is contained in:
Abdessamad Derraz committed 2026-11-04 03:55:07 +01:00
1 parent d8f8e865dc
commit 531edaa1ad
3 files changed
+34 -6

No files matched your search

+18
View File
@@ -404,5 +404,23 @@ class SearchConsoleOwnership(unittest.TestCase):
(DIST / "index.html").read_text(encoding="utf-8"))
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."""
def test_sony_is_split_by_console(self):
source = (REPO_ROOT / "scripts" / "generate_site.py").read_text(encoding="utf-8")
self.assertIn('CONSOLE_PAGES = frozenset({"Sony"})', source)
self.assertIn("manufacturer in CONSOLE_PAGES", source)
@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"):
with self.subTest(page=slug):
self.assertTrue((DIST / "systems" / slug / "index.html").is_file())
if __name__ == "__main__":
unittest.main()