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:
Yangshun Tay 2019-05-13 00:16:15 -07:00 committed by GitHub
parent 070723697f
commit 23b50f17a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 258 additions and 119 deletions

View file

@ -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};
}
/**