mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-11 13:58:04 +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 @@
|
|||
async function execute() {
|
||||
const extractTranslations = require('../write-translations.js');
|
||||
|
||||
const metadataUtils = require('./metadataUtils');
|
||||
|
||||
const CWD = process.cwd();
|
||||
const cssnano = require('cssnano');
|
||||
const fs = require('fs-extra');
|
||||
|
@ -147,8 +149,9 @@ async function execute() {
|
|||
return;
|
||||
}
|
||||
|
||||
let rawContent = readMetadata.extractMetadata(fs.readFileSync(file, 'utf8'))
|
||||
.rawContent;
|
||||
let rawContent = metadataUtils.extractMetadata(
|
||||
fs.readFileSync(file, 'utf8')
|
||||
).rawContent;
|
||||
|
||||
const language = metadata.language;
|
||||
|
||||
|
@ -261,7 +264,7 @@ async function execute() {
|
|||
.replace('-', '/')
|
||||
.replace('-', '/')
|
||||
.replace(/\.md$/, '.html');
|
||||
const result = readMetadata.extractMetadata(
|
||||
const result = metadataUtils.extractMetadata(
|
||||
fs.readFileSync(normalizedFile, {encoding: 'utf8'})
|
||||
);
|
||||
const rawContent = result.rawContent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue