mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-14 09:37:37 +02:00
* fix: #1114 static files in `blog/assets` is not working * lint fix
This commit is contained in:
parent
db6017903b
commit
a1e7af7e0e
6 changed files with 114 additions and 23 deletions
|
@ -7,8 +7,9 @@
|
|||
const React = require('react');
|
||||
const path = require('path');
|
||||
const fs = require('fs-extra');
|
||||
const {renderToStaticMarkupWithDoctype} = require('./renderUtils');
|
||||
const metadataUtils = require('./metadataUtils');
|
||||
const {replaceAssetsLink} = require('./utils.js');
|
||||
const {renderToStaticMarkupWithDoctype} = require('./renderUtils');
|
||||
|
||||
function urlToSource(url) {
|
||||
if (!url || typeof url !== 'string') {
|
||||
|
@ -56,7 +57,10 @@ function getMetadata(file) {
|
|||
fs.readFileSync(file, {encoding: 'utf8'}),
|
||||
);
|
||||
const metadata = Object.assign(
|
||||
{path: fileToUrl(file), content: result.rawContent},
|
||||
{
|
||||
path: fileToUrl(file),
|
||||
content: replaceAssetsLink(result.rawContent, 'blog'),
|
||||
},
|
||||
result.metadata,
|
||||
);
|
||||
metadata.id = metadata.title;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue