diff --git a/package.json b/package.json index 97e70c6..15d416c 100644 --- a/package.json +++ b/package.json @@ -7,32 +7,33 @@ "url": "https://github.com/gatsbyjs/gatsby-starter-blog/issues" }, "dependencies": { - "gatsby": "^1.0.0", - "gatsby-link": "^1.0.0", + "gatsby": "^1.6.5", + "gatsby-link": "^1.6.5", "gatsby-plugin-google-analytics": "^1.0.0", "gatsby-plugin-manifest": "^1.0.0", "gatsby-plugin-offline": "^1.0.0", "gatsby-plugin-preact": "^1.0.0", "gatsby-plugin-react-helmet": "^1.0.0", - "gatsby-plugin-sharp": "^1.0.0", - "gatsby-remark-copy-linked-files": "^1.0.0", - "gatsby-remark-prismjs": "^1.0.0", - "gatsby-remark-responsive-iframe": "^1.0.0", - "gatsby-remark-images": "^1.0.0", - "gatsby-remark-smartypants": "^1.0.0", - "gatsby-source-filesystem": "^1.0.0", - "gatsby-transformer-remark": "^1.0.0", - "gatsby-transformer-sharp": "^1.0.0", + "gatsby-plugin-sharp": "^1.6.0", + "gatsby-remark-copy-linked-files": "^1.5.0", + "gatsby-remark-images": "^1.5.0", + "gatsby-remark-prismjs": "^1.2.0", + "gatsby-remark-responsive-iframe": "^1.4.1", + "gatsby-remark-smartypants": "^1.4.1", + "gatsby-source-filesystem": "^1.4.1", + "gatsby-transformer-remark": "^1.6.3", + "gatsby-transformer-sharp": "^1.6.0", "lodash": "^4.15.0", "react-responsive-grid": "^0.3.3", - "react-typography": "^0.15.0", - "typeface-merriweather": "^0.0.25", - "typeface-montserrat": "^0.0.24", - "typography": "^0.15.8", + "react-typography": "^0.16.1", + "typeface-merriweather": "0.0.25", + "typeface-montserrat": "0.0.24", + "typography": "^0.16.0", "typography-theme-wordpress-2016": "^0.15.1" }, "devDependencies": { - "gh-pages": "^0.12.0" + "gh-pages": "^0.12.0", + "prettier": "^1.5.3" }, "homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme", "keywords": [ @@ -48,6 +49,7 @@ "dev": "gatsby develop", "lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .", "test": "echo \"Error: no test specified\" && exit 1", + "format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'", "develop": "gatsby develop", "build": "gatsby build", "deploy": "gatsby build --prefix-paths && gh-pages -d public", diff --git a/src/components/Bio.js b/src/components/Bio.js index 38ad02e..d2cdbc9 100644 --- a/src/components/Bio.js +++ b/src/components/Bio.js @@ -1,11 +1,11 @@ -import React from "react" +import React from 'react' // Import typefaces -import "typeface-montserrat" -import "typeface-merriweather" +import 'typeface-montserrat' +import 'typeface-merriweather' -import profilePic from "./profile-pic.jpg" -import { rhythm } from "../utils/typography" +import profilePic from './profile-pic.jpg' +import { rhythm } from '../utils/typography' class Bio extends React.Component { render() { @@ -19,19 +19,15 @@ class Bio extends React.Component { src={profilePic} alt={`Kyle Mathews`} style={{ - float: "left", + float: 'left', marginRight: rhythm(1 / 4), marginBottom: 0, width: rhythm(2), height: rhythm(2), }} /> - Written by - {" "} - Kyle Mathews - {" "} - who lives and works in San Francisco building useful things. - {" "} + Written by Kyle Mathews who lives and works in San + Francisco building useful things.{' '} You should follow him on Twitter diff --git a/src/html.js b/src/html.js index 7472e8e..04e0dd1 100644 --- a/src/html.js +++ b/src/html.js @@ -1,7 +1,7 @@ -import React from "react" -import { TypographyStyle } from "react-typography" +import React from 'react' +import { TypographyStyle } from 'react-typography' -import typography from "./utils/typography" +import typography from './utils/typography' let stylesStr if (process.env.NODE_ENV === `production`) { diff --git a/src/layouts/index.js b/src/layouts/index.js index 133ab89..3f960eb 100644 --- a/src/layouts/index.js +++ b/src/layouts/index.js @@ -1,14 +1,14 @@ -import React from "react" -import Link from "gatsby-link" -import { Container } from "react-responsive-grid" +import React from 'react' +import Link from 'gatsby-link' +import { Container } from 'react-responsive-grid' -import { rhythm, scale } from "../utils/typography" +import { rhythm, scale } from '../utils/typography' class Template extends React.Component { render() { const { location, children } = this.props let header - if (location.pathname === "/") { + if (location.pathname === '/') { header = (

Gatsby Starter Blog @@ -33,18 +33,18 @@ class Template extends React.Component { header = (

Gatsby Starter Blog diff --git a/src/pages/index.js b/src/pages/index.js index 7fef5ee..d990a59 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,20 +1,20 @@ -import React from "react" -import Link from "gatsby-link" -import get from "lodash/get" -import Helmet from "react-helmet" +import React from 'react' +import Link from 'gatsby-link' +import get from 'lodash/get' +import Helmet from 'react-helmet' -import Bio from "../components/Bio" -import { rhythm } from "../utils/typography" +import Bio from '../components/Bio' +import { rhythm } from '../utils/typography' class BlogIndex extends React.Component { render() { // console.log("props", this.props) const pageLinks = [] - const siteTitle = get(this, "props.data.site.siteMetadata.title") - const posts = get(this, "props.data.allMarkdownRemark.edges") + const siteTitle = get(this, 'props.data.site.siteMetadata.title') + const posts = get(this, 'props.data.allMarkdownRemark.edges') posts.forEach(post => { - if (post.node.path !== "/404/") { - const title = get(post, "node.frontmatter.title") || post.node.path + if (post.node.path !== '/404/') { + const title = get(post, 'node.frontmatter.title') || post.node.path pageLinks.push(
  • - + {post.node.frontmatter.title}
  • @@ -32,7 +32,7 @@ class BlogIndex extends React.Component { return (
    - +
      {pageLinks} diff --git a/src/templates/blog-post.js b/src/templates/blog-post.js index 0298c88..a5bfa8a 100644 --- a/src/templates/blog-post.js +++ b/src/templates/blog-post.js @@ -1,15 +1,15 @@ -import React from "react" -import Helmet from "react-helmet" -import Link from "gatsby-link" -import get from "lodash/get" +import React from 'react' +import Helmet from 'react-helmet' +import Link from 'gatsby-link' +import get from 'lodash/get' -import Bio from "../components/Bio" -import { rhythm, scale } from "../utils/typography" +import Bio from '../components/Bio' +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 siteTitle = get(this.props, 'data.site.siteMetadata.title') return (
      @@ -20,7 +20,7 @@ class BlogPostTemplate extends React.Component {