import { defineConfig } from "vitepress";

// Galaxy project site. The single-origin deployment serves this static
// build at the root (`/`); the game UI lives under `/game/`. The site is
// Markdown-first with the default theme's two-column navigation (left:
// chapters; right: on-this-page), LaTeX math, and a minimal monospace
// theme. Internationalisation uses VitePress `locales`, which renders the
// built-in language switcher in the nav bar.
export default defineConfig({
  title: "Galaxy",
  description: "Galaxy — a turn-based space strategy game.",
  cleanUrls: true,
  // READMEs (this dir's and any future per-section ones) are developer
  // docs, not site pages.
  srcExclude: ["**/README.md"],
  // The game UI is served from `/game/` by the edge Caddy, not by
  // VitePress, so its links must skip the dead-link checker.
  ignoreDeadLinks: [/^\/game\//],
  markdown: {
    // LaTeX via markdown-it-mathjax3: inline `$…$`, block `$$…$$`.
    math: true,
  },
  themeConfig: {
    outline: { level: [2, 3], label: "On this page" },
  },
  locales: {
    root: {
      label: "English",
      lang: "en",
      themeConfig: {
        // 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",
            items: [{ text: "Overview", link: "/" }],
          },
        ],
      },
    },
    ru: {
      label: "Русский",
      lang: "ru",
      link: "/ru/",
      themeConfig: {
        nav: [{ text: "Играть", link: "/game/", target: "_self" }],
        sidebar: [
          {
            text: "Galaxy",
            items: [{ text: "Обзор", link: "/ru/" }],
          },
        ],
      },
    },
  },
});
