Vitepress Theme Akari Docsv1.0.0GitHubSettingsMore

Configuration ​

Config lives in the docs folder, at two levels:

  • docs/config.ts: config shared by every language.
  • docs/<language code>/config.ts: the config of one language, for example docs/en-US/config.ts. A folder with this file is a language folder.

A field in a language config replaces the field of the same name in the shared config, and objects merge field by field, so a language config only holds what differs for that language. docs/.vitepress/config.mts only wires the theme into VitePress; you rarely need to change it.

text
docs/
├─ config.ts                 shared config
├─ en-US/                    English, at the site root
│  ├─ config.ts              language config
│  └─ …                      pages, see "Writing pages"
├─ zh-CN/                    Simplified Chinese, under /zh-CN/
│  ├─ config.ts
│  └─ …
└─ .vitepress/config.mts

Shared config ​

What is the same in every language: the root language, the logo, the version and social links, the icons and order of the categories, settings and search.

ts
// docs/config.ts
import { defineAkariConfig } from "./.vitepress/theme/define.ts";

export default defineAkariConfig({
  // The language folder served at the site root
  rootLanguage: "en-US",
  logo: "/logo.svg",
  head: [["link", { rel: "icon", type: "image/svg+xml", href: "/logo.svg" }]],
  appBar: {
    version: "v1.0.0",
    socialLinks: [
      { icon: "github", link: "https://github.com/OasisAkari/vitepress-theme-akari-docs", label: "GitHub" },
    ],
  },
  sidebar: {
    // Category folder names and icons; the key order is the order in the rail
    categories: {
      "getting-started": { icon: "rocket_launch" },
      theme: { icon: "palette" },
    },
  },
  settings: { storageKey: "akari-docs-settings" },
  search: { maxResults: 8 },
  footer: { copyright: "Vitepress Theme Akari Docs" },
});

Language config ​

The language's titles and text on this site. lang defaults to the folder name, and the theme picks the language pack from it: the name in the language menu, the text direction, the interface strings and the code block copy button's text all come from the pack, and you override them here when needed.

ts
// docs/en-US/config.ts
import { defineAkariConfig } from "../.vitepress/theme/define.ts";

export default defineAkariConfig({
  title: "Vitepress Theme Akari Docs",
  description: "A documentation theme built on VitePress and M3E Web Components",
  appBar: { title: "Vitepress Theme Akari Docs" },
  sidebar: {
    categories: {
      "getting-started": { text: "Getting started" },
      theme: { text: "Theme" },
    },
  },
  footer: { message: "Built with VitePress and M3E Web Components" },
});

Common changes ​

ToWrite inField
Change the site nameLanguage configtitle, appBar.title
Add a version or social linksShared configappBar.version, appBar.socialLinks
Change the order or icons of categoriesShared configsidebar.categories
Rename a categoryLanguage configsidebar.categories.<folder>.text
Change the default color and light and dark modeShared configsettings.defaults
Turn off search or connect a search backendShared configsearch
Change the footer message and copyrightLanguage config / shared configfooter.message, footer.copyright
Rewrite interface textLanguage configmessages
Add a languageA new language folderSee Internationalization

For the type and default of every field, see API. For how the config layers and how languages and navigation are generated, see Details.

GitHub Settings

Search the docs

Type a page title, a component name or words from the text.

Press ⌘/Ctrl + K to open it anytime

Choose a language

EnglishEnglish (United States)العربيةArabic (Saudi Arabia)FrançaisFrench (France)日本語Japanese (Japan)한국어Korean (South Korea)简体中文Chinese (China)

Settings

Color
VariantTonal SpotVibrantFidelityExpressiveMonochromeNeutralRainbowFruit Salad
ContrastDefaultMediumHigh
MotionStandardExpressive
Text directionFollow languageLeft to rightRight to left
Text size100%150%200%