From ec98639d497bdaa6cfbdca9f70cae0abc6ebabb0 Mon Sep 17 00:00:00 2001 From: Ilia Denisov Date: Sat, 23 May 2026 19:13:15 +0200 Subject: [PATCH] fix(site): link to the game with target=_self to avoid VitePress SPA 404 VitePress is a Vue SPA; a same-origin link to /game/ (a separate app, not a VitePress page) was intercepted by its client router and rendered VitePress's own 404 until a manual reload. Mark the game links (both home pages and the nav item) target="_self" so the click is a real browser navigation that the edge Caddy serves from the game bundle. Co-Authored-By: Claude Opus 4.7 (1M context) --- site/.vitepress/config.ts | 8 ++++++-- site/index.md | 2 +- site/ru/index.md | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/site/.vitepress/config.ts b/site/.vitepress/config.ts index 745afab..ea181a5 100644 --- a/site/.vitepress/config.ts +++ b/site/.vitepress/config.ts @@ -28,7 +28,11 @@ export default defineConfig({ label: "English", lang: "en", themeConfig: { - nav: [{ text: "Play", link: "/game/" }], + // The game is a separate app under /game/, not a VitePress page. + // target "_self" makes the link a real navigation (full load), + // not a client-side SPA route — otherwise VitePress shows its + // own 404 for the unknown route. + nav: [{ text: "Play", link: "/game/", target: "_self" }], sidebar: [ { text: "Galaxy", @@ -42,7 +46,7 @@ export default defineConfig({ lang: "ru", link: "/ru/", themeConfig: { - nav: [{ text: "Играть", link: "/game/" }], + nav: [{ text: "Играть", link: "/game/", target: "_self" }], sidebar: [ { text: "Galaxy", diff --git a/site/index.md b/site/index.md index 7609ee2..a3e249d 100644 --- a/site/index.md +++ b/site/index.md @@ -2,4 +2,4 @@ A turn-based space strategy game. -[Play the game →](/game/) +[Play the game →](/game/){target="_self"} diff --git a/site/ru/index.md b/site/ru/index.md index cd0687d..1de372e 100644 --- a/site/ru/index.md +++ b/site/ru/index.md @@ -2,4 +2,4 @@ Пошаговая космическая стратегия. -[Играть →](/game/) +[Играть →](/game/){target="_self"}