mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-09 23:27:28 +02:00
Allow the docs not to just be in a folder called docs
Also: - regex escaping - update api documentation
This commit is contained in:
parent
dc0c1390c4
commit
e273dfc13b
5 changed files with 25 additions and 9 deletions
|
@ -21,7 +21,8 @@ let versions;
|
|||
if (ENABLE_VERSIONING) {
|
||||
versions = require(CWD + "/versions.json");
|
||||
}
|
||||
require("../../server/readMetadata.js").generateMetadataDocs();
|
||||
const readMetadata = require("../../server/readMetadata.js");
|
||||
readMetadata.generateMetadataDocs();
|
||||
const Metadata = require("../metadata.js");
|
||||
|
||||
// language dropdown nav item for when translations are enabled
|
||||
|
@ -221,9 +222,10 @@ class HeaderNav extends React.Component {
|
|||
}
|
||||
let search = false;
|
||||
headerLinks.forEach(link => {
|
||||
if (link.doc && !fs.existsSync(CWD + "/../docs/")) {
|
||||
if (link.doc && !fs.existsSync(CWD + "/../" + readMetadata.getDocsPath() + "/")) {
|
||||
throw new Error(
|
||||
"You have 'doc' in your headerLinks, but no 'docs' folder exists one level up from " +
|
||||
"You have 'doc' in your headerLinks, but no '" + readMetadata.getDocsPath() +
|
||||
"' folder exists one level up from " +
|
||||
"'website' folder. Did you run `docusaurus-init` or `npm run examples`? If so, " +
|
||||
"make sure you rename 'docs-examples-from-docusaurus' to 'docs'."
|
||||
);
|
||||
|
@ -231,7 +233,7 @@ class HeaderNav extends React.Component {
|
|||
if (link.blog && !fs.existsSync(CWD + "/blog/")) {
|
||||
throw new Error(
|
||||
"You have 'blog' in your headerLinks, but no 'blog' folder exists in your " +
|
||||
"website folder. Did you run `docusaurus-init` or `npm run examples`? If so, " +
|
||||
"'website' folder. Did you run `docusaurus-init` or `npm run examples`? If so, " +
|
||||
"make sure you rename 'blog-examples-from-docusaurus' to 'blog'."
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue