Update for v2

This commit is contained in:
Kyle Mathews 2018-05-31 11:04:16 -07:00
parent 33ec149396
commit 10cae373f5
7 changed files with 7489 additions and 6183 deletions

View file

@ -9,8 +9,11 @@ class Template extends React.Component {
let header
let rootPath = `/`
if (typeof __PREFIX_PATHS__ !== `undefined` && __PREFIX_PATHS__) {
rootPath = __PATH_PREFIX__ + `/`
if (
typeof window.__PREFIX_PATHS__ !== `undefined` &&
window.__PREFIX_PATHS__
) {
rootPath = window.__PATH_PREFIX__ + `/`
}
if (location.pathname === rootPath) {
@ -66,7 +69,7 @@ class Template extends React.Component {
}}
>
{header}
{children()}
{children}
</div>
)
}

View file

@ -4,6 +4,7 @@ import get from 'lodash/get'
import Helmet from 'react-helmet'
import Bio from '../components/Bio'
import Layout from '../components/layout'
import { rhythm } from '../utils/typography'
class BlogIndex extends React.Component {
@ -12,7 +13,7 @@ class BlogIndex extends React.Component {
const posts = get(this, 'props.data.allMarkdownRemark.edges')
return (
<div>
<Layout location={this.props.location}>
<Helmet title={siteTitle} />
<Bio />
{posts.map(({ node }) => {
@ -33,7 +34,7 @@ class BlogIndex extends React.Component {
</div>
)
})}
</div>
</Layout>
)
}
}

View file

@ -4,16 +4,17 @@ import Link from 'gatsby-link'
import get from 'lodash/get'
import Bio from '../components/Bio'
import Layout from '../components/layout'
import { rhythm, scale } from '../utils/typography'
class BlogPostTemplate extends React.Component {
render() {
const post = this.props.data.markdownRemark
const siteTitle = get(this.props, 'data.site.siteMetadata.title')
const { previous, next } = this.props.pathContext
const { previous, next } = this.props.pageContext
return (
<div>
<Layout location={this.props.location}>
<Helmet title={`${post.frontmatter.title} | ${siteTitle}`} />
<h1>{post.frontmatter.title}</h1>
<p
@ -59,7 +60,7 @@ class BlogPostTemplate extends React.Component {
</li>
)}
</ul>
</div>
</Layout>
)
}
}

View file

@ -17,3 +17,5 @@ if (process.env.NODE_ENV !== 'production') {
}
export default typography
export const rhythm = typography.rhythm
export const scale = typography.scale