mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +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
|
@ -44,6 +44,7 @@ tcpPortUsed.check(port, "localhost")
|
|||
);
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log("Starting Docusaurus server on port " + port + "...");
|
||||
// start local server on specified port
|
||||
const server = require("./server/server.js");
|
||||
server(port);
|
||||
|
|
|
@ -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