fix: change subcategory format (#1026)

* fix: change subcategory format

* Fix sidebars

* Refactor

* Fix implementation

* Change format
This commit is contained in:
Yangshun Tay 2018-10-10 08:33:20 -07:00 committed by GitHub
parent c277f46a60
commit fe500dea82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 493 additions and 15047 deletions

View file

@ -66,30 +66,10 @@ function autoPrefixCss(cssContent) {
.then(result => result.css);
}
// Validate the docs in the sidebar are valid
function validateSidebar(metadata, sidebarMetadatas) {
if (metadata.next) {
if (!sidebarMetadatas[metadata.next]) {
throw new Error(
metadata.version
? `Improper sidebars file for version ${
metadata.version
}, document with id '${
metadata.next
}' not found. Make sure that all documents with ids specified in this version's sidebar file exist and that no ids are repeated.`
: `Improper sidebars.json file, document with id '${
metadata.next
}' not found. Make sure that documents with the ids specified in sidebars.json exist and that no ids are repeated.`,
);
}
}
}
module.exports = {
getSubDir,
getLanguage,
isSeparateCss,
minifyCss,
autoPrefixCss,
validateSidebar,
};