mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-25 06:56:56 +02:00
ESLintify Part 2 (#841)
* ESLintify Part 2 * Fix * Fix tests * Fix tests * Fix tests
This commit is contained in:
parent
4267337fb0
commit
5ac2cee658
42 changed files with 188 additions and 190 deletions
|
@ -80,7 +80,7 @@ const versionFolder = CWD + '/versioned_docs/version-' + version;
|
|||
mkdirp.sync(versionFolder);
|
||||
|
||||
// copy necessary files to new version, changing some of its metadata to reflect the versioning
|
||||
let files = glob.sync(CWD + '/../' + readMetadata.getDocsPath() + '/**');
|
||||
const files = glob.sync(CWD + '/../' + readMetadata.getDocsPath() + '/**');
|
||||
files.forEach(file => {
|
||||
const ext = path.extname(file);
|
||||
if (ext !== '.md' && ext !== '.markdown') {
|
||||
|
@ -88,12 +88,12 @@ files.forEach(file => {
|
|||
}
|
||||
|
||||
const res = metadataUtils.extractMetadata(fs.readFileSync(file, 'utf8'));
|
||||
let metadata = res.metadata;
|
||||
const metadata = res.metadata;
|
||||
// Don't version any docs without any metadata whatsoever.
|
||||
if (Object.keys(metadata).length === 0) {
|
||||
return;
|
||||
}
|
||||
let rawContent = res.rawContent;
|
||||
const rawContent = res.rawContent;
|
||||
if (!metadata.id) {
|
||||
metadata.id = path.basename(file, path.extname(file));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue