mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 07:37:19 +02:00
* Duplicate code in readMetadata.js & versionFallback.js #725 * Putting back package-lock.json * Rename lib/server/utilsMetadata.js -> lib/server/metadataUtils.js * Update splitHeader + extractMetadata * Update prettier
This commit is contained in:
parent
de8da1ca54
commit
a77ae958db
7 changed files with 100 additions and 101 deletions
|
@ -8,6 +8,8 @@
|
|||
function execute(port) {
|
||||
const extractTranslations = require('../write-translations');
|
||||
|
||||
const metadataUtils = require('./metadataUtils');
|
||||
|
||||
const env = require('./env.js');
|
||||
const translation = require('./translation');
|
||||
const express = require('express');
|
||||
|
@ -186,8 +188,9 @@ function execute(port) {
|
|||
return;
|
||||
}
|
||||
|
||||
let rawContent = readMetadata.extractMetadata(fs.readFileSync(file, 'utf8'))
|
||||
.rawContent;
|
||||
let rawContent = metadataUtils.extractMetadata(
|
||||
fs.readFileSync(file, 'utf8')
|
||||
).rawContent;
|
||||
|
||||
// generate table of contents if appropriate
|
||||
if (rawContent && rawContent.indexOf(TABLE_OF_CONTENTS_TOKEN) !== -1) {
|
||||
|
@ -326,7 +329,7 @@ function execute(port) {
|
|||
file = file.replace(new RegExp('/', 'g'), '-');
|
||||
file = join(CWD, 'blog', file);
|
||||
|
||||
const result = readMetadata.extractMetadata(
|
||||
const result = metadataUtils.extractMetadata(
|
||||
fs.readFileSync(file, {encoding: 'utf8'})
|
||||
);
|
||||
let rawContent = result.rawContent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue