mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-19 20:17:06 +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;
|
const id = langPart + versionPart + link.doc;
|
||||||
if (!Metadata[id]) {
|
if (!Metadata[id]) {
|
||||||
if (id != link.doc) {
|
let errorStr =
|
||||||
throw new Error(
|
"Processing the following `doc` field in `headerLinks` within `siteConfig.js`: '" +
|
||||||
"It looks like you've enabled language support, but haven't provided translated files. The document with id: '" +
|
link.doc +
|
||||||
id +
|
"'";
|
||||||
"' doesn't exist."
|
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(
|
throw new Error(errorStr);
|
||||||
'A headerLink is specified with a document that does not exist. No document exists with id: ' +
|
|
||||||
link.doc
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
href = this.props.config.baseUrl + Metadata[id].permalink;
|
href = this.props.config.baseUrl + Metadata[id].permalink;
|
||||||
} else if (link.page) {
|
} else if (link.page) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue