mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-19 09:37:43 +02:00
fix: reload siteConfig.js automatically when locally served page is refreshed (#1509)
* fix: livereload siteConfig * fix test * nits
This commit is contained in:
parent
aa157969cf
commit
166816af40
11 changed files with 53 additions and 42 deletions
|
@ -360,7 +360,7 @@ function generateMetadataDocs() {
|
|||
}
|
||||
|
||||
// process metadata for blog posts and save into core/MetadataBlog.js
|
||||
function generateMetadataBlog() {
|
||||
function generateMetadataBlog(config = siteConfig) {
|
||||
const metadatas = [];
|
||||
|
||||
const files = glob.sync(`${CWD}/blog/**/*.*`);
|
||||
|
@ -372,7 +372,7 @@ function generateMetadataBlog() {
|
|||
if (extension !== '.md' && extension !== '.markdown') {
|
||||
return;
|
||||
}
|
||||
const metadata = blog.getMetadata(file);
|
||||
const metadata = blog.getMetadata(file, config);
|
||||
// Extract, YYYY, MM, DD from the file name
|
||||
const filePathDateArr = path.basename(file).split('-');
|
||||
metadata.date = new Date(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue