Discuss Sitegen (React based static site generator) and Reactdown (markdown based rich document format).
title
metadata value
includePage
in src/index.js
by src/babel/QueryAPIBabelPlugin.js
Wow, I had to grep for includePage
throughout the repo in order to find the place where it's rewritten. Can someone explain me the reasoning behind transforming the code like that? It looks so mysterious to me.
includePages('./posts/*')
is better than require('page?glob=./posts/*!')
<Sitegen.Meta />
so any page can inject <title />
or <meta />
into the <head />
.
includePages('./posts/*.md')
), is there a way for the posts.js component to get frontmatter values from the currently-rendered page and display them? something like:// posts.js
export class component extends React.Component {
render () {
const pageMeta = getCurrentPage().meta
return (
<div>
<h2>{pageMeta.title}</h2>
<span className='post-date'>{formatDate(pageMeta.date)}</span>
{this.props.children}
</div>
)
}
}