Source for the AbstractMenus plugin docs site, built with Astro + Starlight.
The site lives at https://abstractmenus.github.io/docs/ and is rebuilt by GitHub Actions on every push to main (see .github/workflows/deploy.yml).
npm install
npm run dev # http://localhost:4321/docs/
npm run build # static output in ./dist
npm run preview # serve ./dist locally
npm test # vitest unit tests for the playgroundRequires Node 20+ (CI runs Node 22).
src/
assets/ logos and images referenced from MDX frontmatter
content/
docs/ Markdown / MDX pages (sidebar order is in astro.config.mjs)
en/ English content
start/ Getting Started
general/ Authoring menus
advanced/ Techniques
developers/ For Developers
changelog/ Changelog landing page
ru/ Russian content (mirrors en/, fills in gradually)
changelog/ Changelog entries (separate collection, rendered by docs/<locale>/changelog/index.mdx)
pages/
feed.xml.ts RSS feed at /docs/feed.xml
grammars/
hocon.tmLanguage.json TextMate grammar for HOCON code blocks
styles/
brand.css custom CSS variables (brand colour, header tint, layout)
public/ files served at the root (favicon, /img/*)
astro.config.mjs Astro + Starlight configuration (sidebar, locales, theme, redirects)
/docs/redirects to/docs/en/.- English content lives at
/docs/en/.... - Russian content lives at
/docs/ru/.... Pages without a Russian translation fall back to English with a "translate this page" notice.
/docs/playground/ is a browser-side editor for HOCON menu configs (CodeMirror 6 + custom HOCON parser, no backend). It lives outside the Starlight content layout so it can use the full viewport.
- Source:
src/lib/playground/ - Pages:
src/pages/playground.astro(editor),src/pages/playground/about.astro(overview) - Styles:
src/styles/playground.css(scoped via<style is:global>on the page; intentionally not registered inastro.config.mjs > customCssso the rest of the docs site is unaffected) - Tests:
npm test(vitest + happy-dom) - Extend autocomplete data in
src/lib/playground/catalog/, add lessons insrc/lib/playground/tutorial/lessons/.
base is set to /docs/ because the site lives at https://abstractmenus.github.io/docs/. Astro does not auto-prefix base for raw URLs inside Markdown. Reference public assets with the base included:
If base ever changes, do a project-wide find/replace /docs/img/ -> /<new-base>/img/. Internal links between docs pages use /docs/<locale>/... (e.g. /docs/en/general/actions/).
-
Drop a new
.md(or.mdx) file undersrc/content/docs/<locale>/<section>/. Add the same path under bothen/andru/if you have both translations. -
Frontmatter at minimum:
--- title: My new page description: One-line summary for search and meta tags. ---
-
Add the slug to the sidebar in
astro.config.mjsunder the right section. Slugs are locale-relative - the sameslug: "start/how-to"resolves toen/start/how-tofor English andru/start/how-tofor Russian.
Use ```hocon for HOCON blocks. The grammar is registered in astro.config.mjs via expressiveCode.shiki.langs.
Both English and Russian are configured under astro.config.mjs > locales. To add a third language:
- Add an entry to
locales(e.g.de: { label: "Deutsch", lang: "de" }). - Create
src/content/docs/de/mirroring the structure ofen/. - Sidebar config in
astro.config.mjsdoesn't change - slugs are locale-relative.
Starlight renders a language picker in the header automatically when more than one locale is configured.