From 772270376dd537800f691dd6073f0a21a7c508c4 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Sun, 3 Sep 2017 16:26:40 -0700 Subject: [PATCH] Update Prettier --- package.json | 2 +- src/pages/index.js | 32 ++++++++++++++------------------ src/templates/blog-post.js | 4 +--- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 36fb37e..4bbbdb7 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "gh-pages": "^0.12.0", - "prettier": "^1.5.3" + "prettier": "^1.6.1" }, "homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme", "keywords": [ diff --git a/src/pages/index.js b/src/pages/index.js index 1a6f115..ed1e104 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,42 +1,38 @@ -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() { - 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') return (
- + {posts.map(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 return ( -
+

{post.node.frontmatter.title}

- - {post.node.frontmatter.date} - + {post.node.frontmatter.date}

) diff --git a/src/templates/blog-post.js b/src/templates/blog-post.js index a5bfa8a..0d4f55e 100644 --- a/src/templates/blog-post.js +++ b/src/templates/blog-post.js @@ -14,9 +14,7 @@ class BlogPostTemplate extends React.Component { return (
-

- {post.frontmatter.title} -

+

{post.frontmatter.title}