Locale Config

These options configure locale-related texts.

If your site is served in a different language besides English, you should set these options per locale to provide translations.

repoLabel

  • Type: string

  • Details:

    Specify the repository label of your project.

    This will be used as the text of the repository link, which will be displayed as the last item of the navbar.

    If you don't set this option explicitly, it will be automatically inferred from the repo option.

selectLanguageText

  • Type: string

  • Details:

    Specify the text of the select language menu.

    The select language menu will appear next to the repository button in the navbar when you set multiple locales in your site config.

selectLanguageAriaLabel

  • Type: string

  • Details:

    Specify the aria-label attribute of the select language menu.

    This is mainly for a11y purpose.

selectLanguageName

  • Type: string

  • Details:

    Specify the name of the language of a locale.

    This option will only take effect inside the locales of your theme config. It will be used as the language name of the locale, which will be displayed in the select language menu.

  • Example:

export default {
  locales: {
    '/': {
      lang: 'en-US',
    },
    '/zh/': {
      lang: 'zh-CN',
    },
  },
  theme: defaultTheme({
    locales: {
      '/': {
        selectLanguageName: 'English',
      },
      '/zh/': {
        selectLanguageName: '简体中文',
      },
    },
  }),
}
  • Type: null | string

  • Details:

    aria-label value for main navigation in navbar.

  • Type: null | string

  • Details:

    aria-label value for next/previous page navigation.

editLinkText

  • Type: string

  • Default: 'Edit this page'

  • Details:

    Specify the text of the edit this page link.

lastUpdatedText

  • Type: string

  • Default: 'Last Updated'

  • Details:

    Specify the text of the last updated timestamp label.

contributorsText

  • Type: string

  • Default: 'Contributors'

  • Details:

    Specify the text of the contributors list label.

tip

  • Type: string

  • Default: 'TIP'

  • Details:

    Specify the default title of the tip custom containers.

warning

  • Type: string

  • Default: 'WARNING'

  • Details:

    Specify the default title of the warning custom containers.

danger

  • Type: string

  • Default: 'DANGER'

  • Details:

    Specify the default title of the danger custom containers.

notFound

  • Type: string[]

  • Default: ['Not Found']

  • Details:

    Specify the messages of the 404 page.

    The message will be randomly picked from the array when users enter the 404 page.

backToHome

  • Type: string

  • Default: 'Back to home'

  • Details:

    Specify the text of the back to home link in the 404 page.

openInNewWindow

toggleColorMode

toggleSidebar

  • Type: string

  • Default: 'toggle sidebar'

  • Details:

    Title text for sidebar toggle button.

    This is mainly for a11y purpose.

prev

  • Type: string

  • Default: 'Prev'

  • Details:

    Text for the previous page navigation button.

next

  • Type: string

  • Default: 'Next'

  • Details:

    Text for the next page navigation button.