Files
galaxy-game/site
Ilia Denisov f9f725f657
Build · Site / build (push) Successful in 8s
Tests · Integration / integration (pull_request) Successful in 1m42s
Build · Site / build (pull_request) Successful in 8s
Tests · Go / test (pull_request) Successful in 3m18s
Tests · UI / test (pull_request) Successful in 3m24s
fix(site): formulas — downgrade markdown-it-mathjax3 to v4 (fix hydration)
The duplicate-then-disappearing formulas were a Vue hydration mismatch,
not a CSS problem. markdown-it-mathjax3 v5 pulls the `mathxyjax3` fork,
which emits each formula's CSS as an in-content `<style>` block scoped to
a per-container `#mjx-<id>` that the static build never sets. The orphaned
scoped CSS left the screen-reader MathML twin visible (the duplicate), and
the in-`<main>` `<style>` elements break VitePress/Vue hydration
("Hydration completed but contains mismatches"), which strips the SVG
glyph `<path>`s and blanks every formula after the page finishes loading.

Downgrade to markdown-it-mathjax3 ^4.3.2 — the mathjax-full-based version
VitePress officially supports. It uses `juice` to inline all CSS into the
element `style` attributes (no in-content `<style>`), so hydration is
clean (glyphs survive) and the MathML twin is hidden by its own inlined
style (no duplicate). This also drops the earlier custom.css workaround,
which only treated the symptom and itself blanked the formulas.

Verified with a headless Chromium render of the built /ru/rules: all 10
formulas keep their glyph paths after hydration, no console mismatch, no
duplicate copies.
2026-05-31 17:03:16 +02:00
..

Galaxy project site

The public project site — an overview today, documentation as it grows. Built with VitePress and served as static files at the root (/) of the single-origin deployment; the game UI lives under /game/ (see tools/dev-deploy/Caddyfile.dev).

Layout

  • index.md, ru/index.md — per-locale home pages.
  • .vitepress/config.ts — site config: locales (English + Russian, with the built-in language switcher), LaTeX math (math: true), and the two-column navigation (left sidebar = chapters, right outline = on-this-page).
  • .vitepress/theme/ — the default theme without bundled fonts, plus a minimal monospace type stack in custom.css.

Authoring

  • Add a page as Markdown and register it in the sidebar of each locale in .vitepress/config.ts.
  • Localised content mirrors the English tree under ru/.
  • Game rules (ru/rules.md) are the one exception to English-first: the Russian page is the authoritative source (ported from the former game/rules.txt), and the English rules.md is its mirror/translation. Keep the two in sync as with FUNCTIONAL.md/FUNCTIONAL_ru.md, but with Russian leading.
  • Math uses LaTeX: inline $E = mc^2$, block $$ … $$.
  • Link to the game with the root-relative /game/ path so the build stays domain-agnostic (no hard-coded host).

Commands

pnpm install
pnpm dev      # local dev server
pnpm build    # static build into .vitepress/dist
pnpm preview  # preview the build

The dev and prod deploys build the site via make -C tools/dev-deploy seed-site and the dev-deploy / prod-build workflows.