mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-07 03:48:01 +02:00
Don't try to version files that have no metadata headers (#197)
This commit is contained in:
parent
459984516b
commit
d26d263bd0
2 changed files with 5 additions and 0 deletions
|
@ -74,6 +74,10 @@ files.forEach(file => {
|
|||
|
||||
const res = readMetadata.extractMetadata(fs.readFileSync(file, "utf8"));
|
||||
let metadata = res.metadata;
|
||||
// Don't version any docs without any metadata whatsoever.
|
||||
if (Object.keys(metadata).length === 0) {
|
||||
return;
|
||||
}
|
||||
let 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