mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-28 08:27:03 +02:00
Initial changes to error messages
This commit is contained in:
parent
e285f93c1b
commit
b256d2f8d9
7 changed files with 45 additions and 6 deletions
|
@ -56,7 +56,7 @@ function readCategories(sidebar) {
|
|||
if (metadata.next) {
|
||||
if (!articles[metadata.next]) {
|
||||
throw new Error(
|
||||
"`next: " + metadata.next + "` in " + metadata.id + " doesn't exist"
|
||||
"Improper sidebars.json file. Make sure that documents with the ids specified in sidebars.json exist and that no ids are repeated."
|
||||
);
|
||||
}
|
||||
previous[articles[metadata.next].id] = metadata.id;
|
||||
|
|
|
@ -32,7 +32,12 @@ if (fs.existsSync(CWD + "/languages.js")) {
|
|||
}
|
||||
|
||||
function readSidebar() {
|
||||
let allSidebars = require(CWD + "/sidebars.json");
|
||||
let allSidebars;
|
||||
if (fs.existsSync(CWD + "/sidebars.json")) {
|
||||
allSidebars = require(CWD + "/sidebars.json");
|
||||
} else {
|
||||
allSidebars = {};
|
||||
}
|
||||
Object.assign(allSidebars, versionFallback.sidebarData());
|
||||
|
||||
const order = {};
|
||||
|
@ -155,7 +160,7 @@ function processMetadata(file) {
|
|||
metadata.previous = language + "-" + order[id].previous;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return { metadata, rawContent: rawContent };
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,10 @@ function execute(port) {
|
|||
});
|
||||
|
||||
const metadata = Metadata[links[url]];
|
||||
if (!metadata) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
const language = metadata.language;
|
||||
|
||||
let file;
|
||||
|
@ -438,7 +442,6 @@ function execute(port) {
|
|||
res.send(cssContent);
|
||||
});
|
||||
|
||||
/* serve static content first from user folder then from docusaurus */
|
||||
app.use(
|
||||
siteConfig.baseUrl + "docs/assets/",
|
||||
express.static(CWD + "/../docs/assets")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue