mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-26 14:37:52 +02:00
parent
d2d3ace924
commit
f72df94dd3
1 changed files with 2 additions and 2 deletions
|
@ -73,7 +73,7 @@ function readSidebar() {
|
|||
function splitHeader(content) {
|
||||
const lines = content.split("\n");
|
||||
if (lines[0] !== "---") {
|
||||
return false;
|
||||
return {};
|
||||
}
|
||||
let i = 1;
|
||||
for (; i < lines.length - 1; ++i) {
|
||||
|
@ -91,7 +91,7 @@ function splitHeader(content) {
|
|||
function extractMetadata(content) {
|
||||
const metadata = {};
|
||||
const both = splitHeader(content);
|
||||
if (both === false) {
|
||||
if (Object.keys(both).length === 0) {
|
||||
return { metadata, rawContent: content };
|
||||
}
|
||||
const lines = both.header.split("\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue