Configuration

Use docs/config.json to define the navigation structure.

  • navbar: top navigation items
  • nav: primary header links shown next to social links
  • sidebar: side navigation groups
  • search: local search options
  • markdown: markdown rendering options

Site URL

Set site.url in docs/config.json to control canonical URLs and OG image URLs in generated HTML.

{
  "site": {
    "url": "https://docs.example.com",
    "title": "Stropress Docs",
    "description": "Documentation site powered by stropress"
  }
}

If site.url is omitted, Stropress falls back to http://localhost:4321 for local development.

Default search uses local MiniSearch indexing from your markdown content.

You can keep the default behavior or set it explicitly in docs/config.json:

{
  "search": {
    "provider": "local"
  }
}

Code Block Theme

Configure code block highlighting theme via markdown.codeTheme in docs/config.json.

Use a single theme:

{
  "markdown": {
    "codeTheme": "github-dark"
  }
}

Or define separate light/dark themes:

{
  "markdown": {
    "codeTheme": {
      "light": "github-light",
      "dark": "github-dark"
    }
  }
}

Common theme names (supported by Astro via Shiki, depending on your Astro/Shiki version):

  • github-light
  • github-dark
  • one-dark-pro
  • dracula
  • nord
  • material-theme-darker
  • catppuccin-latte
  • catppuccin-frappe
  • catppuccin-macchiato
  • catppuccin-mocha

Example with One Dark + Catppuccin:

{
  "markdown": {
    "codeTheme": {
      "light": "catppuccin-latte",
      "dark": "one-dark-pro"
    }
  }
}

If a theme name is invalid for your current version, build/dev will report a theme loading error.

Bilingual Locales

Stropress supports locale blocks inspired by VitePress.

Define locales in docs/config.json, using path prefixes as keys:

{
  "locales": {
    "/": {
      "label": "English",
      "lang": "en-US"
    },
    "/zh/": {
      "label": "简体中文",
      "lang": "zh-CN",
      "site": {
        "title": "Stropress 文档",
        "description": "使用 Stropress 构建文档站点"
      },
      "nav": [
        {
          "label": "指南",
          "link": "/zh/guide/getting-started"
        }
      ],
      "sidebar": [
        {
          "label": "指南",
          "items": [
            {
              "label": "快速开始",
              "link": "/zh/guide/getting-started"
            }
          ]
        }
      ]
    }
  }
}

Recommendations:

  • Put localized markdown under folders such as docs/zh/....
  • Use locale-prefixed links in locale nav, navbar, and sidebar.
  • Add docs/zh/index.md to enable a clean /zh/ landing route.

Custom Homepage

If JSON-based home configuration is too limiting, you can add Astro homepage files next to config.json:

docs/
  config.json
  index.astro
  zh/
    index.astro
  • docs/index.astro overrides the root homepage /.
  • docs/zh/index.astro overrides the localized homepage /zh/.
  • If a matching index.astro exists, Stropress will prefer it over home or locales[locale].home.

These files render inside the default docs layout. You can optionally export page metadata from Astro frontmatter:

---
export const title = "Custom Home";
export const description = "Landing page built with Astro";
export const sidebar = false;
---

<section>
  <h1>Custom homepage</h1>
</section>

Global Style Overrides

You can add a root-level stylesheet at docs/index.css to override the default theme styles globally.

This file is loaded after the built-in theme CSS, so it can be used to override :root variables and any selectors used by the theme.

:root {
  --background-color: 250 247 240;
  --foreground-color: 28 28 28;
  --primary-color: 176 78 44;
}

.topbar {
  backdrop-filter: blur(20px);
}