[WIP] Allow custom subpath for docs within the "docs" folder

e.g.,

The default is

`docs/*.md`

This allows

`docs/somedir/*.md`

or

`docs/somedir/anotherdir/*.md`

Notes:

- All URLs are still /docs/*.html (i.e. the subpath does not get preserved in the link).
- Files in `translated_docs`, if any, will still only be one level
- This should not affect translations or versioning
This commit is contained in:
Joel Marcey 2017-11-08 20:16:05 -08:00
parent 9f32a28d32
commit dc0c1390c4
5 changed files with 24 additions and 12 deletions

View file

@ -48,7 +48,7 @@ function execute() {
};
// look through markdown headers of docs for titles and categories to translate
let files = glob.sync(CWD + "/../docs/**");
let files = glob.sync(CWD + "/../" + readMetadata.getDocsPath() + "/**");
files.forEach(file => {
const extension = path.extname(file);
if (extension === ".md" || extension === ".markdown") {
@ -91,7 +91,7 @@ function execute() {
files.forEach(file => {
if (!file.endsWith("-sidebars.json")) {
if (file.endsWith("-sidebar.json")) {
console.warn(`Skipping ${file}. Make sure your sidebar filenames follow this format: 'version-VERSION-sidebars.json'.`);
console.warn(`Skipping ${file}. Make sure your sidebar filenames follow this format: 'version-VERSION-sidebars.json'.`);
}
return;
}