Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

Sitemap: keep .html on pages whose slug ends in index (4 addresses were 404) (#113)

Mikek2a17950c9eb7
diff --git a/docs/sitemap.xml b/docs/sitemap.xml
index e7f74ef061b..6a884fba31a 100644
--- a/docs/sitemap.xml
+++ b/docs/sitemap.xml
@@ -159,7 +159,7 @@
<url><loc>https://didimlabs.com/ko/mac/archeage.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/ko/mac/archvale.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/ko/mac/arctic-eggs.html</loc><lastmod>2026-11-11</lastmod></url>
- <url><loc>https://didimlabs.com/ko/mac/are-you-ready-for-valve-</loc><lastmod>2026-11-11</lastmod></url>
+ <url><loc>https://didimlabs.com/ko/mac/are-you-ready-for-valve-index.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/ko/mac/arena-breakout-infinite.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/ko/mac/arid.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/ko/mac/arizona-sunshine.html</loc><lastmod>2026-11-11</lastmod></url>
@@ -5043,7 +5043,7 @@
<url><loc>https://didimlabs.com/mac/ardarium.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/ardenfall.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/ardor.html</loc><lastmod>2026-11-11</lastmod></url>
- <url><loc>https://didimlabs.com/mac/are-you-ready-for-valve-</loc><lastmod>2026-11-11</lastmod></url>
+ <url><loc>https://didimlabs.com/mac/are-you-ready-for-valve-index.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/are-you-smarter-than-a-5th-grader.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/area-4643.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/arena-an-age-of-barbarians-story.html</loc><lastmod>2026-11-11</lastmod></url>
@@ -15498,7 +15498,7 @@
<url><loc>https://didimlabs.com/mac/good-things-vol-1.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/goodbye-deponia.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/goodbye-volcano-high.html</loc><lastmod>2026-11-11</lastmod></url>
- <url><loc>https://didimlabs.com/mac/goodbye-world-</loc><lastmod>2026-11-11</lastmod></url>
+ <url><loc>https://didimlabs.com/mac/goodbye-world-index.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/goodbye-world.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/goodnight-lily.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/goodnight-universe.html</loc><lastmod>2026-11-11</lastmod></url>
@@ -23452,7 +23452,7 @@
<url><loc>https://didimlabs.com/mac/nodes-escape.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/nodes.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/noesis01.html</loc><lastmod>2026-11-11</lastmod></url>
- <url><loc>https://didimlabs.com/mac/nofio-wireless-adapter-for-valve-</loc><lastmod>2026-11-11</lastmod></url>
+ <url><loc>https://didimlabs.com/mac/nofio-wireless-adapter-for-valve-index.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/noir-chronicles-city-of-crime.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/noise.html</loc><lastmod>2026-11-11</lastmod></url>
<url><loc>https://didimlabs.com/mac/noisz.html</loc><lastmod>2026-11-11</lastmod></url>
diff --git a/site/mac_games.py b/site/mac_games.py
index 19d78b2726a..baa6e815756 100644
--- a/site/mac_games.py
+++ b/site/mac_games.py
@@ -492,7 +492,8 @@ def main():
s = sm.read_text()
urls = []
for p in sorted(out):
- loc = SITE + (p[:-len("index.html")] if p.endswith("index.html") else p)
+ # Only a folder index loses its file name: valve-index.html is a page of its own.
+ loc = SITE + (p[:-len("index.html")] if p == "index.html" or p.endswith("/index.html") else p)
urls.append(f" <url><loc>{loc}</loc><lastmod>{CHECKED}</lastmod></url>")
block = " <!-- mac-games -->\n" + "\n".join(urls) + "\n <!-- /mac-games -->\n"
if "<!-- mac-games -->" in s:
diff --git a/tests/test_mac_games.py b/tests/test_mac_games.py
index 8423276acc2..f145956847f 100644
--- a/tests/test_mac_games.py
+++ b/tests/test_mac_games.py
@@ -27,6 +27,13 @@ class MacGamePages(unittest.TestCase):
if "ko" in g:
self.assertTrue((ROOT / "docs/ko/mac" / (g["slug"] + ".html")).is_file())
+ def test_every_sitemap_address_is_a_page(self):
+ # A slug ending in "index" (Valve Index games) once lost ".html" and led Google to 404s.
+ import re
+ for loc in re.findall(r"<loc>https://didimlabs\.com/([^<]*)</loc>", (ROOT / "docs/sitemap.xml").read_text()):
+ path = ROOT / "docs" / (loc + "index.html" if loc == "" or loc.endswith("/") else loc)
+ self.assertTrue(path.is_file(), loc)
+
if __name__ == "__main__":
unittest.main()