mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
parent
4637de9a52
commit
250395a96a
1 changed files with 18 additions and 10 deletions
|
@ -133,17 +133,25 @@ class HeaderNav extends React.Component {
|
|||
: '';
|
||||
const id = langPart + versionPart + link.doc;
|
||||
if (!Metadata[id]) {
|
||||
if (id != link.doc) {
|
||||
throw new Error(
|
||||
"It looks like you've enabled language support, but haven't provided translated files. The document with id: '" +
|
||||
id +
|
||||
"' doesn't exist."
|
||||
);
|
||||
let errorStr =
|
||||
"Processing the following `doc` field in `headerLinks` within `siteConfig.js`: '" +
|
||||
link.doc +
|
||||
"'";
|
||||
if (id === link.doc) {
|
||||
errorStr +=
|
||||
' It looks like there is no document with that id that exists in your docs directory. Please double check the spelling of your `doc` field and the `id` fields of your docs.';
|
||||
} else {
|
||||
errorStr +=
|
||||
'. Check the spelling of your `doc` field. If that seems sane, and a document in your docs folder exists with that `id` value, \nthen this is likely a bug in Docusaurus.' +
|
||||
' Docusaurus thinks one or both of translations (currently set to: ' +
|
||||
env.translation.enabled +
|
||||
') or versioning (currently set to: ' +
|
||||
env.versioning.enabled +
|
||||
") is enabled when maybe they should not be. \nThus my internal id for this doc is: '" +
|
||||
id +
|
||||
"'. Please file an issue for this possible bug on GitHub.";
|
||||
}
|
||||
throw new Error(
|
||||
'A headerLink is specified with a document that does not exist. No document exists with id: ' +
|
||||
link.doc
|
||||
);
|
||||
throw new Error(errorStr);
|
||||
}
|
||||
href = this.props.config.baseUrl + Metadata[id].permalink;
|
||||
} else if (link.page) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue