Skip to content

Pages with redirects instead of translations when docsUrl === '' and path to file includes 'en' #2306

@kav137

Description

@kav137

🐛 Bug Report

When docsUrl is set to an empty string, localization enabled and path to the file contains "en" letters, then pages with redirects would be generated instead of pages with contents. So, it is impossible to reach the content

Have you read the Contributing Guidelines on issues?

yes

To Reproduce

  1. run npm run examples translations to make localization files available
  2. enable any other language (let's say "ru") in translations.js
  3. in docs folder create a folder named "components" (or any other name, containing "en" letters) and put .md file there
  4. add a link to that file to sidebars.js, so that you can reach it
  5. copy the content of docs folder to website/translated_docs/ru so that localized files are visible to the system
  6. set docsUrl: '' in siteConfig.js
  7. run npm run build

Expected behavior

file build/test-site/ru/components/myFile.html contains data from the original file website/translated_docs/ru/components/myFile.md

Actual Behavior

file build/test-site/ru/components/myFile.html contains redirection link to the file itself

Please, see the screenshot

image

Reproducible Demo

kav137/docusaurusDocs@5e54a03

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executionv1This issue is for Docusaurus 1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions