mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-07 11:57:55 +02:00
Don't throw if a doc hasn't been versioned yet (#455)
Instead of throwing, return `null` because that means we have a new doc in our versioning sequence (Also, cleaned up a bit of code as I researched this) Partial Fix To #450
This commit is contained in:
parent
5dd8b7334b
commit
1388e13795
2 changed files with 2 additions and 5 deletions
|
@ -96,8 +96,7 @@ files.forEach(file => {
|
|||
metadata.original_id = metadata.id;
|
||||
metadata.id = 'version-' + version + '-' + metadata.id;
|
||||
|
||||
const targetFile =
|
||||
CWD + '/versioned_docs/version-' + version + '/' + path.basename(file);
|
||||
const targetFile = versionFolder + '/' + path.basename(file);
|
||||
|
||||
fs.writeFileSync(targetFile, makeHeader(metadata) + rawContent, 'utf8');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue