diff --git a/README.md b/README.md index 729ccb1..4e71935 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,6 @@ Gatsby starter for creating a blog Install this starter (assuming Gatsby is installed) by running from your CLI: `gatsby new gatsby-blog https://github.com/gatsbyjs/gatsby-starter-blog` + +## Running in development +`gatsby develop` diff --git a/components/ReadNext.jsx b/components/ReadNext.js similarity index 91% rename from components/ReadNext.jsx rename to components/ReadNext.js index ea98c3c..a1baf84 100644 --- a/components/ReadNext.jsx +++ b/components/ReadNext.js @@ -6,17 +6,18 @@ import { rhythm, fontSizeToMS } from 'utils/typography' class ReadNext extends React.Component { render () { - const readNext = this.props.post.readNext + const { pages, post } = this.props + const { readNext } = post let nextPost if (readNext) { - nextPost = find(this.props.pages, (page) => + nextPost = find(pages, (page) => includes(page.path, readNext) ) } if (!nextPost) { return React.createElement('noscript', null) } else { - nextPost = find(this.props.pages, (page) => + nextPost = find(pages, (page) => includes(page.path, readNext.slice(1, -1)) ) // Create pruned version of the body. diff --git a/html.jsx b/html.js similarity index 86% rename from html.jsx rename to html.js index 23be058..f43e182 100644 --- a/html.jsx +++ b/html.js @@ -4,14 +4,8 @@ import { link } from 'gatsby-helpers' import { TypographyStyle } from 'utils/typography' export default class Html extends React.Component { - propTypes () { - return { - body: React.PropTypes.string, - favicon: React.PropTypes.string, - title: React.PropTypes.string, - } - } render () { + const { favicon, body } = this.props let title = DocumentTitle.rewind() if (this.props.title) { title = this.props.title @@ -27,7 +21,7 @@ export default class Html extends React.Component { content="user-scalable=no width=device-width, initial-scale=1.0 maximum-scale=1.0" />