fix: give the home page a descriptive title

This commit is contained in:
Abdessamad Derraz committed 2026-10-18 17:19:25 +02:00
1 parent e56621de42
commit d5dd16dbdb
2 files changed
+13 -1

No files matched your search

+3 -1
View File
@@ -1187,7 +1187,9 @@ def _browser_title(relative: Path, title: str) -> str:
"""Return a concise, unique browser/search title for a generated page."""
key = relative.as_posix()
index_titles = {
"index.md": SITE_NAME,
# Material appends " - RetroBIOS": the home title says what the site
# is, instead of "RetroBIOS - RetroBIOS".
"index.md": "BIOS and firmware packs for RetroArch, Batocera and more",
"platforms/index.md": "Platforms",
"systems/index.md": "Systems",
"emulators/index.md": "Emulators",
+10
View File
@@ -232,5 +232,15 @@ class TheSitemapIsAnnouncedWhereCrawlersLook(unittest.TestCase):
self.assertNotIn("Sitemap: https://", source)
class TheHomeTitleSaysWhatTheSiteIs(unittest.TestCase):
def test_not_the_site_name_twice(self):
from generate_site import SITE_NAME, _browser_title
title = _browser_title(Path("index.md"), SITE_NAME)
self.assertNotEqual(title, SITE_NAME)
self.assertIn("BIOS", title)
if __name__ == "__main__":
unittest.main()