Update Prettier

This commit is contained in:
Kyle Mathews 2017-09-03 16:26:40 -07:00
parent 769381a6e7
commit 772270376d
3 changed files with 16 additions and 22 deletions

View file

@ -32,7 +32,7 @@
}, },
"devDependencies": { "devDependencies": {
"gh-pages": "^0.12.0", "gh-pages": "^0.12.0",
"prettier": "^1.5.3" "prettier": "^1.6.1"
}, },
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme", "homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
"keywords": [ "keywords": [

View file

@ -1,42 +1,38 @@
import React from "react" import React from 'react'
import Link from "gatsby-link" import Link from 'gatsby-link'
import get from "lodash/get" import get from 'lodash/get'
import Helmet from "react-helmet" import Helmet from 'react-helmet'
import Bio from "../components/Bio" import Bio from '../components/Bio'
import { rhythm } from "../utils/typography" import { rhythm } from '../utils/typography'
class BlogIndex extends React.Component { class BlogIndex extends React.Component {
render() { render() {
const siteTitle = get(this, "props.data.site.siteMetadata.title") const siteTitle = get(this, 'props.data.site.siteMetadata.title')
const posts = get(this, "props.data.allMarkdownRemark.edges") const posts = get(this, 'props.data.allMarkdownRemark.edges')
return ( return (
<div> <div>
<Helmet title={get(this, "props.data.site.siteMetadata.title")} /> <Helmet title={get(this, 'props.data.site.siteMetadata.title')} />
<Bio /> <Bio />
{posts.map(post => { {posts.map(post => {
if (post.node.path !== "/404/") { if (post.node.path !== '/404/') {
const title = get(post, "node.frontmatter.title") || post.node.path const title = get(post, 'node.frontmatter.title') || post.node.path
return ( return (
<div <div key={post.node.frontmatter.path}>
key={post.node.frontmatter.path}
>
<h3 <h3
style={{ style={{
marginBottom: rhythm(1 / 4), marginBottom: rhythm(1 / 4),
}} }}
> >
<Link <Link
style={{ boxShadow: "none" }} style={{ boxShadow: 'none' }}
to={post.node.frontmatter.path} to={post.node.frontmatter.path}
> >
{post.node.frontmatter.title} {post.node.frontmatter.title}
</Link> </Link>
</h3> </h3>
<small> <small>{post.node.frontmatter.date}</small>
{post.node.frontmatter.date}
</small>
<p dangerouslySetInnerHTML={{ __html: post.node.excerpt }} /> <p dangerouslySetInnerHTML={{ __html: post.node.excerpt }} />
</div> </div>
) )

View file

@ -14,9 +14,7 @@ class BlogPostTemplate extends React.Component {
return ( return (
<div> <div>
<Helmet title={`${post.frontmatter.title} | ${siteTitle}`} /> <Helmet title={`${post.frontmatter.title} | ${siteTitle}`} />
<h1> <h1>{post.frontmatter.title}</h1>
{post.frontmatter.title}
</h1>
<p <p
style={{ style={{
...scale(-1 / 5), ...scale(-1 / 5),