mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 08:37:25 +02:00
refactor(v2): blog data revamp (#1450)
* refactor(v2): blog data revamp * fix(v2): fix incorrect blog total count * misc: remove console.log * feat(v2): export frontMatter as an object within MDX file (#1451) * refactor. Don't confuse metadata & frontmatter * export frontMatter in content itself * nits * nits name * dont truncate first four lines in blog
This commit is contained in:
parent
070723697f
commit
23b50f17a1
18 changed files with 258 additions and 119 deletions
|
@ -166,7 +166,7 @@ function getSubFolder(file, refDir) {
|
|||
* @returns {Object}
|
||||
*/
|
||||
function parse(fileString) {
|
||||
const {data: metadata, content, excerpt} = matter(fileString, {
|
||||
const {data: frontMatter, content, excerpt} = matter(fileString, {
|
||||
excerpt(file) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
file.excerpt = file.content
|
||||
|
@ -175,7 +175,7 @@ function parse(fileString) {
|
|||
.shift();
|
||||
},
|
||||
});
|
||||
return {metadata, content, excerpt};
|
||||
return {frontMatter, content, excerpt};
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue