From 65431b45bb4539a339b7be0639b6b93bb695f9fd Mon Sep 17 00:00:00 2001 From: Gianluca Esposito Date: Sun, 21 Feb 2016 23:45:50 +0100 Subject: [PATCH] Update dependencies, use .js file extensions --- README.md | 3 +++ components/{ReadNext.jsx => ReadNext.js} | 7 ++++--- html.jsx => html.js | 18 +++++++++--------- package.json | 11 ++++++----- pages/{_template.jsx => _template.js} | 5 +++-- pages/{index.jsx => index.js} | 0 wrappers/{md.jsx => md.js} | 5 +++-- 7 files changed, 28 insertions(+), 21 deletions(-) rename components/{ReadNext.jsx => ReadNext.js} (91%) rename html.jsx => html.js (86%) rename pages/{_template.jsx => _template.js} (92%) rename pages/{index.jsx => index.js} (100%) rename wrappers/{md.jsx => md.js} (92%) 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" /> {this.props.title} - +