Skip to content

feat: set English locale as default #35

@gretmn102

Description

@gretmn102

Если сменить defaultLocale: 'ru', на en, то:

  • /docs/intro отдает английскую страницу
  • /ru/docs/intro выбивает "Page Not Found"

Т.е. нужно как-то заставить Docusaurus отдавать содержимое папки /docs по /ru/docs роуту. И он это делает, если запускать через npm run start -- --locale ru. А всему виной ограничения:

Each locale is a distinct standalone single-page application: it is not possible to start the Docusaurus sites in all locales at the same time.
https://docusaurus.io/docs/i18n/tutorial#start-your-site

i18n.localeConfigs.ru.path

Установка i18n.localeConfigs.ru.path на /docs не помогла:

i18n: {
  localeConfigs: {
    ru: {
      path: "/docs"
    }
}

routeBasePath

Если установить routeBasePath на "ru/docs", то ко всем ссылкам добавляется ru:

  • /docs/intro меняется на /ru/docs/intro и отдает статью на английском
  • /ru/docs/intro — на /ru/ru/docs/intro и все равно выбивает "Page Not Found"

Переместить /docs в /i18n/ru

Если переместить /docs в /18n/ru/docusaurus-plugin-content-docs/current/ то выбивает:

[ERROR] Error: The docs folder does not exist for version "current". A docs folder is expected to be found at docs.

Источники

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions