mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
parent
d2d3ace924
commit
f72df94dd3
|
|
@ -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…
Reference in New Issue