Update packages and run prettier
This commit is contained in:
parent
6bc49591c3
commit
8f03c8589e
6 changed files with 63 additions and 65 deletions
34
package.json
34
package.json
|
|
@ -7,32 +7,33 @@
|
||||||
"url": "https://github.com/gatsbyjs/gatsby-starter-blog/issues"
|
"url": "https://github.com/gatsbyjs/gatsby-starter-blog/issues"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"gatsby": "^1.0.0",
|
"gatsby": "^1.6.5",
|
||||||
"gatsby-link": "^1.0.0",
|
"gatsby-link": "^1.6.5",
|
||||||
"gatsby-plugin-google-analytics": "^1.0.0",
|
"gatsby-plugin-google-analytics": "^1.0.0",
|
||||||
"gatsby-plugin-manifest": "^1.0.0",
|
"gatsby-plugin-manifest": "^1.0.0",
|
||||||
"gatsby-plugin-offline": "^1.0.0",
|
"gatsby-plugin-offline": "^1.0.0",
|
||||||
"gatsby-plugin-preact": "^1.0.0",
|
"gatsby-plugin-preact": "^1.0.0",
|
||||||
"gatsby-plugin-react-helmet": "^1.0.0",
|
"gatsby-plugin-react-helmet": "^1.0.0",
|
||||||
"gatsby-plugin-sharp": "^1.0.0",
|
"gatsby-plugin-sharp": "^1.6.0",
|
||||||
"gatsby-remark-copy-linked-files": "^1.0.0",
|
"gatsby-remark-copy-linked-files": "^1.5.0",
|
||||||
"gatsby-remark-prismjs": "^1.0.0",
|
"gatsby-remark-images": "^1.5.0",
|
||||||
"gatsby-remark-responsive-iframe": "^1.0.0",
|
"gatsby-remark-prismjs": "^1.2.0",
|
||||||
"gatsby-remark-images": "^1.0.0",
|
"gatsby-remark-responsive-iframe": "^1.4.1",
|
||||||
"gatsby-remark-smartypants": "^1.0.0",
|
"gatsby-remark-smartypants": "^1.4.1",
|
||||||
"gatsby-source-filesystem": "^1.0.0",
|
"gatsby-source-filesystem": "^1.4.1",
|
||||||
"gatsby-transformer-remark": "^1.0.0",
|
"gatsby-transformer-remark": "^1.6.3",
|
||||||
"gatsby-transformer-sharp": "^1.0.0",
|
"gatsby-transformer-sharp": "^1.6.0",
|
||||||
"lodash": "^4.15.0",
|
"lodash": "^4.15.0",
|
||||||
"react-responsive-grid": "^0.3.3",
|
"react-responsive-grid": "^0.3.3",
|
||||||
"react-typography": "^0.15.0",
|
"react-typography": "^0.16.1",
|
||||||
"typeface-merriweather": "^0.0.25",
|
"typeface-merriweather": "0.0.25",
|
||||||
"typeface-montserrat": "^0.0.24",
|
"typeface-montserrat": "0.0.24",
|
||||||
"typography": "^0.15.8",
|
"typography": "^0.16.0",
|
||||||
"typography-theme-wordpress-2016": "^0.15.1"
|
"typography-theme-wordpress-2016": "^0.15.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gh-pages": "^0.12.0"
|
"gh-pages": "^0.12.0",
|
||||||
|
"prettier": "^1.5.3"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
|
"homepage": "https://github.com/gatsbyjs/gatsby-starter-blog#readme",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
@ -48,6 +49,7 @@
|
||||||
"dev": "gatsby develop",
|
"dev": "gatsby develop",
|
||||||
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
|
"lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .",
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"format": "prettier --trailing-comma es5 --no-semi --single-quote --write 'src/**/*.js'",
|
||||||
"develop": "gatsby develop",
|
"develop": "gatsby develop",
|
||||||
"build": "gatsby build",
|
"build": "gatsby build",
|
||||||
"deploy": "gatsby build --prefix-paths && gh-pages -d public",
|
"deploy": "gatsby build --prefix-paths && gh-pages -d public",
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
import React from "react"
|
import React from 'react'
|
||||||
|
|
||||||
// Import typefaces
|
// Import typefaces
|
||||||
import "typeface-montserrat"
|
import 'typeface-montserrat'
|
||||||
import "typeface-merriweather"
|
import 'typeface-merriweather'
|
||||||
|
|
||||||
import profilePic from "./profile-pic.jpg"
|
import profilePic from './profile-pic.jpg'
|
||||||
import { rhythm } from "../utils/typography"
|
import { rhythm } from '../utils/typography'
|
||||||
|
|
||||||
class Bio extends React.Component {
|
class Bio extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
|
|
@ -19,19 +19,15 @@ class Bio extends React.Component {
|
||||||
src={profilePic}
|
src={profilePic}
|
||||||
alt={`Kyle Mathews`}
|
alt={`Kyle Mathews`}
|
||||||
style={{
|
style={{
|
||||||
float: "left",
|
float: 'left',
|
||||||
marginRight: rhythm(1 / 4),
|
marginRight: rhythm(1 / 4),
|
||||||
marginBottom: 0,
|
marginBottom: 0,
|
||||||
width: rhythm(2),
|
width: rhythm(2),
|
||||||
height: rhythm(2),
|
height: rhythm(2),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
Written by
|
Written by <strong>Kyle Mathews</strong> who lives and works in San
|
||||||
{" "}
|
Francisco building useful things.{' '}
|
||||||
<strong>Kyle Mathews</strong>
|
|
||||||
{" "}
|
|
||||||
who lives and works in San Francisco building useful things.
|
|
||||||
{" "}
|
|
||||||
<a href="https://twitter.com/kylemathews">
|
<a href="https://twitter.com/kylemathews">
|
||||||
You should follow him on Twitter
|
You should follow him on Twitter
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from "react"
|
import React from 'react'
|
||||||
import { TypographyStyle } from "react-typography"
|
import { TypographyStyle } from 'react-typography'
|
||||||
|
|
||||||
import typography from "./utils/typography"
|
import typography from './utils/typography'
|
||||||
|
|
||||||
let stylesStr
|
let stylesStr
|
||||||
if (process.env.NODE_ENV === `production`) {
|
if (process.env.NODE_ENV === `production`) {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import React from "react"
|
import React from 'react'
|
||||||
import Link from "gatsby-link"
|
import Link from 'gatsby-link'
|
||||||
import { Container } from "react-responsive-grid"
|
import { Container } from 'react-responsive-grid'
|
||||||
|
|
||||||
import { rhythm, scale } from "../utils/typography"
|
import { rhythm, scale } from '../utils/typography'
|
||||||
|
|
||||||
class Template extends React.Component {
|
class Template extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const { location, children } = this.props
|
const { location, children } = this.props
|
||||||
let header
|
let header
|
||||||
if (location.pathname === "/") {
|
if (location.pathname === '/') {
|
||||||
header = (
|
header = (
|
||||||
<h1
|
<h1
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -19,11 +19,11 @@ class Template extends React.Component {
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
style={{
|
style={{
|
||||||
boxShadow: "none",
|
boxShadow: 'none',
|
||||||
textDecoration: "none",
|
textDecoration: 'none',
|
||||||
color: "inherit",
|
color: 'inherit',
|
||||||
}}
|
}}
|
||||||
to={"/"}
|
to={'/'}
|
||||||
>
|
>
|
||||||
Gatsby Starter Blog
|
Gatsby Starter Blog
|
||||||
</Link>
|
</Link>
|
||||||
|
|
@ -33,18 +33,18 @@ class Template extends React.Component {
|
||||||
header = (
|
header = (
|
||||||
<h3
|
<h3
|
||||||
style={{
|
style={{
|
||||||
fontFamily: "Montserrat, sans-serif",
|
fontFamily: 'Montserrat, sans-serif',
|
||||||
marginTop: 0,
|
marginTop: 0,
|
||||||
marginBottom: rhythm(-1),
|
marginBottom: rhythm(-1),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link
|
<Link
|
||||||
style={{
|
style={{
|
||||||
boxShadow: "none",
|
boxShadow: 'none',
|
||||||
textDecoration: "none",
|
textDecoration: 'none',
|
||||||
color: "inherit",
|
color: 'inherit',
|
||||||
}}
|
}}
|
||||||
to={"/"}
|
to={'/'}
|
||||||
>
|
>
|
||||||
Gatsby Starter Blog
|
Gatsby Starter Blog
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
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() {
|
||||||
// console.log("props", this.props)
|
// console.log("props", this.props)
|
||||||
const pageLinks = []
|
const pageLinks = []
|
||||||
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')
|
||||||
posts.forEach(post => {
|
posts.forEach(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
|
||||||
pageLinks.push(
|
pageLinks.push(
|
||||||
<li
|
<li
|
||||||
key={post.node.frontmatter.path}
|
key={post.node.frontmatter.path}
|
||||||
|
|
@ -22,7 +22,7 @@ class BlogIndex extends React.Component {
|
||||||
marginBottom: rhythm(1 / 4),
|
marginBottom: rhythm(1 / 4),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Link style={{ boxShadow: "none" }} to={post.node.frontmatter.path}>
|
<Link style={{ boxShadow: 'none' }} to={post.node.frontmatter.path}>
|
||||||
{post.node.frontmatter.title}
|
{post.node.frontmatter.title}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -32,7 +32,7 @@ class BlogIndex extends React.Component {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Helmet title={get(this, "props.data.site.siteMetadata.title")} />
|
<Helmet title={get(this, 'props.data.site.siteMetadata.title')} />
|
||||||
<Bio />
|
<Bio />
|
||||||
<ul>
|
<ul>
|
||||||
{pageLinks}
|
{pageLinks}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
import React from "react"
|
import React from 'react'
|
||||||
import Helmet from "react-helmet"
|
import Helmet from 'react-helmet'
|
||||||
import Link from "gatsby-link"
|
import Link from 'gatsby-link'
|
||||||
import get from "lodash/get"
|
import get from 'lodash/get'
|
||||||
|
|
||||||
import Bio from "../components/Bio"
|
import Bio from '../components/Bio'
|
||||||
import { rhythm, scale } from "../utils/typography"
|
import { rhythm, scale } from '../utils/typography'
|
||||||
|
|
||||||
class BlogPostTemplate extends React.Component {
|
class BlogPostTemplate extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
const post = this.props.data.markdownRemark
|
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 (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -20,7 +20,7 @@ class BlogPostTemplate extends React.Component {
|
||||||
<p
|
<p
|
||||||
style={{
|
style={{
|
||||||
...scale(-1 / 5),
|
...scale(-1 / 5),
|
||||||
display: "block",
|
display: 'block',
|
||||||
marginBottom: rhythm(1),
|
marginBottom: rhythm(1),
|
||||||
marginTop: rhythm(-1),
|
marginTop: rhythm(-1),
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue