Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Nov 13, 2017
1 parent faffba9 commit 3267d6e
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 65 deletions.
9 changes: 6 additions & 3 deletions examples/using-react-url-query/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@ export default class IndexPage extends React.PureComponent {
The example shows how to use{` `}
<a href="https://github.com/pbeshai/react-url-query">
react-url-query
</a>{` `}
</a>
{` `}
for binding url query parameters to props.
</p>
<hr />
<p>
The value of this input is reflected in the URL as the <code>t</code>{` `}
The value of this input is reflected in the URL as the <code>t</code>
{` `}
query parameter (with a max length of 8).
</p>
<div>
<label htmlFor="search-input">String:</label>
<SearchInput id="search-input" style={{ marginLeft: `0.5em` }} />
</div>
<p>
The value of this input is reflected in the URL as the <code>n</code>{` `}
The value of this input is reflected in the URL as the <code>n</code>
{` `}
query parameter.
</p>
<div>
Expand Down
8 changes: 4 additions & 4 deletions examples/using-remark-copy-linked-files/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const _ = require("lodash")
const Promise = require('bluebird')
const path = require('path')
const _ = require(`lodash`)
const Promise = require(`bluebird`)
const path = require(`path`)

exports.createPages = ({ graphql, boundActionCreators }) => {
const { createPage } = boundActionCreators

return new Promise((resolve, reject) => {
const blogPost = path.resolve("./src/templates/blog-post.js")
const blogPost = path.resolve(`./src/templates/blog-post.js`)
resolve(
graphql(
`
Expand Down
14 changes: 7 additions & 7 deletions examples/using-remark-copy-linked-files/src/components/Bio.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
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() {
return (
<div
style={{
display: 'flex',
display: `flex`,
marginBottom: rhythm(2.5),
}}
>
Expand All @@ -28,7 +28,7 @@ class Bio extends React.Component {
/>
<p>
Written by <strong>Kyle Mathews</strong> who lives and works in San
Francisco building useful things.{' '}
Francisco building useful things.{` `}
<a href="https://twitter.com/kylemathews">
You should follow him on Twitter
</a>
Expand Down
22 changes: 11 additions & 11 deletions examples/using-remark-copy-linked-files/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
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 (
<div>
<Helmet title={siteTitle} />
<Bio />
{posts.map(post => {
if (post.node.frontmatter.path !== '/404/') {
const title = get(post, 'node.frontmatter.title') || post.node.path
if (post.node.frontmatter.path !== `/404/`) {
const title = get(post, `node.frontmatter.title`) || post.node.path
return (
<div key={post.node.frontmatter.path}>
<h3
Expand All @@ -26,7 +26,7 @@ class BlogIndex extends React.Component {
}}
>
<Link
style={{ boxShadow: 'none' }}
style={{ boxShadow: `none` }}
to={post.node.frontmatter.path}
>
{title}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react'
import Helmet from 'react-helmet'
import get from 'lodash/get'
import React from "react"
import Helmet from "react-helmet"
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 (
<div>
Expand All @@ -17,7 +17,7 @@ class BlogPostTemplate extends React.Component {
<p
style={{
...scale(-1 / 5),
display: 'block',
display: `block`,
marginBottom: rhythm(1),
marginTop: rhythm(-1),
}}
Expand Down
56 changes: 29 additions & 27 deletions examples/using-remark-copy-linked-files/src/utils/typography.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
import Typography from "typography"
import Wordpress2016 from "typography-theme-wordpress-2016"

Wordpress2016.overrideThemeStyles = () => {return {
"a.gatsby-resp-image-link": {
boxShadow: `none`,
},
".caption": {
maxWidth: `24rem`,
display: `block`,
lineHeight: 1.6,
},
".caption code": {
lineHeight: 1,
fontStyle: `normal`,
},
code: {
background: `#fdf6e3`,
color: `rgba(0,0,0,0.75)`,
},
".fail": {
color: `crimson`,
fontWeight: `bold`,
borderBottom: `2px solid crimson`,
},
".win": {
color: `limegreen`,
fontWeight: `bold`,
},
}}
Wordpress2016.overrideThemeStyles = () => {
return {
"a.gatsby-resp-image-link": {
boxShadow: `none`,
},
".caption": {
maxWidth: `24rem`,
display: `block`,
lineHeight: 1.6,
},
".caption code": {
lineHeight: 1,
fontStyle: `normal`,
},
code: {
background: `#fdf6e3`,
color: `rgba(0,0,0,0.75)`,
},
".fail": {
color: `crimson`,
fontWeight: `bold`,
borderBottom: `2px solid crimson`,
},
".win": {
color: `limegreen`,
fontWeight: `bold`,
},
}
}

const typography = new Typography(Wordpress2016)

Expand Down
5 changes: 4 additions & 1 deletion packages/gatsby/cache-dir/component-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class ComponentRenderer extends React.Component {

// This covers layout for when page not found, especially during production
if (!loader.getPage(location.pathname)) {
location = Object.assign({}, location, { ...location, pathname: `/404.html` })
location = Object.assign({}, location, {
...location,
pathname: `/404.html`,
})
}

this.state = {
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/cache-dir/production-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ apiRunnerAsync(`onClientEntry`).then(() => {
} else {
return createElement(ComponentRenderer, {
page: true,
location: { pathname: `/404.html` }
location: { pathname: `/404.html` },
})
}
},
Expand Down
10 changes: 6 additions & 4 deletions www/src/templates/template-blog-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ class BlogPostTemplate extends React.Component {
{post.frontmatter.image && (
<meta
name="og:image"
content={`https://gatsbyjs.org${post.frontmatter.image
.childImageSharp.resize.src}`}
content={`https://gatsbyjs.org${
post.frontmatter.image.childImageSharp.resize.src
}`}
/>
)}
{post.frontmatter.image && (
<meta
name="twitter:image"
content={`https://gatsbyjs.org${post.frontmatter.image
.childImageSharp.resize.src}`}
content={`https://gatsbyjs.org${
post.frontmatter.image.childImageSharp.resize.src
}`}
/>
)}
<meta name="og:type" content="article" />
Expand Down

0 comments on commit 3267d6e

Please sign in to comment.