Skip to content

Commit

Permalink
Update Prettier and run format
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Aug 31, 2018
1 parent be44c03 commit dd1f13e
Show file tree
Hide file tree
Showing 140 changed files with 1,022 additions and 916 deletions.
Expand Up @@ -2,7 +2,7 @@
title: What's coming in Gatsby 1.0
date: "2017-02-23"
author: "Kyle Mathews"
image: 'ui-and-code.png'
image: "ui-and-code.png"
draft: true
---

Expand Down
143 changes: 71 additions & 72 deletions docs/blog/2017-07-19-creating-a-blog-with-gatsby/index.md
Expand Up @@ -99,10 +99,7 @@ module.exports = {
title: `Your Name - Blog`,
author: `Your Name`,
},
plugins: [
'gatsby-plugin-catch-links',
'gatsby-plugin-react-helmet',
],
plugins: ["gatsby-plugin-catch-links", "gatsby-plugin-react-helmet"],
}
```

Expand Down Expand Up @@ -134,16 +131,16 @@ yarn add gatsby-source-filesystem
module.exports = {
// previous configuration
plugins: [
'gatsby-plugin-catch-links',
'gatsby-plugin-react-helmet',
"gatsby-plugin-catch-links",
"gatsby-plugin-react-helmet",
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
name: "pages",
},
}
]
},
],
}
```

Expand Down Expand Up @@ -184,24 +181,24 @@ and editing `gatsby-config.js`
```javascript{13-18}
module.exports = {
// previous setup
plugins: [
'gatsby-plugin-catch-links',
'gatsby-plugin-react-helmet',
plugins: [
"gatsby-plugin-catch-links",
"gatsby-plugin-react-helmet",
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/pages`,
name: 'pages',
name: "pages",
},
},
{
resolve: 'gatsby-transformer-remark',
resolve: "gatsby-transformer-remark",
options: {
plugins: [] // just in case those previously mentioned remark plugins sound cool :)
}
plugins: [], // just in case those previously mentioned remark plugins sound cool :)
},
},
]
};
],
}
```

Whew! Seems like a lot of set up, but collectively these plugins are going to
Expand Down Expand Up @@ -298,25 +295,26 @@ piece of data our query selects will be injected via the `data` property we
specified earlier.

```javascript{21-32}
import React from 'react';
import Helmet from 'react-helmet';
import { graphql } from 'gatsby';
import React from "react"
import Helmet from "react-helmet"
import { graphql } from "gatsby"
// import '../css/blog-post.css';
export default function Template({
data
}) {
const { markdownRemark: post } = data;
export default function Template({ data }) {
const { markdownRemark: post } = data
return (
<div className="blog-post-container">
<Helmet title={`Your Blog Name - ${post.frontmatter.title}`} />
<div className="blog-post">
<h1>{post.frontmatter.title}</h1>
<div className="blog-post-content" dangerouslySetInnerHTML={{ __html: post.html }} />
<div
className="blog-post-content"
dangerouslySetInnerHTML={{ __html: post.html }}
/>
</div>
</div>
);
)
}
export const pageQuery = graphql`
Expand All @@ -330,7 +328,7 @@ export const pageQuery = graphql`
}
}
}
`;
`
```

If you're not familar with GraphQL, this may seem slightly confusing, but we can
Expand Down Expand Up @@ -401,32 +399,33 @@ query, which will fetch all of our Markdown posts.
### Querying for posts

```javascript{8-31}
const path = require('path');
const path = require("path")
exports.createPages = ({ boundActionCreators, graphql }) => {
const { createPage } = boundActionCreators;
const { createPage } = boundActionCreators
const blogPostTemplate = path.resolve(`src/templates/blog-post.js`);
const blogPostTemplate = path.resolve(`src/templates/blog-post.js`)
return graphql(`{
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 1000
) {
edges {
node {
frontmatter {
path
return graphql(`
{
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 1000
) {
edges {
node {
frontmatter {
path
}
}
}
}
}
}`)
.then(result => {
if (result.errors) {
return Promise.reject(result.errors);
}
});
`).then(result => {
if (result.errors) {
return Promise.reject(result.errors)
}
})
}
```

Expand All @@ -449,41 +448,41 @@ pages (with the `createPage` action creator). Let's do that!
### Creating the pages

```javascript{32-39}
const path = require('path');
const path = require("path")
exports.createPages = ({ boundActionCreators, graphql }) => {
const { createPage } = boundActionCreators;
const { createPage } = boundActionCreators
const blogPostTemplate = path.resolve(`src/templates/blog-post.js`);
const blogPostTemplate = path.resolve(`src/templates/blog-post.js`)
return graphql(`{
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 1000
) {
edges {
node {
frontmatter {
path
return graphql(`
{
allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
limit: 1000
) {
edges {
node {
frontmatter {
path
}
}
}
}
}
}`)
.then(result => {
if (result.errors) {
return Promise.reject(result.errors);
}
`).then(result => {
if (result.errors) {
return Promise.reject(result.errors)
}
result.data.allMarkdownRemark.edges
.forEach(({ node }) => {
createPage({
path: node.frontmatter.path,
component: blogPostTemplate,
context: {} // additional data can be passed via context
});
});
});
result.data.allMarkdownRemark.edges.forEach(({ node }) => {
createPage({
path: node.frontmatter.path,
component: blogPostTemplate,
context: {}, // additional data can be passed via context
})
})
})
}
```

Expand Down
10 changes: 9 additions & 1 deletion docs/blog/2017-10-05-portfolio-site-gatsby-wordpress/index.md
Expand Up @@ -4,7 +4,15 @@ date: "2017-10-05"
image: "gatsby-article-cover-image.jpg"
author: "David James"
excerpt: "Recreating my WordPress portfolio site using GatsbyJS, React and the WordPress REST API"
tags: ["portfolio-site", "wordpress", "graphql", "plugins", "performance", "getting-started"]
tags:
[
"portfolio-site",
"wordpress",
"graphql",
"plugins",
"performance",
"getting-started",
]
---

_This article was originally published on
Expand Down
6 changes: 2 additions & 4 deletions docs/blog/2017-10-17-building-i18n-with-gatsby/index.md
Expand Up @@ -142,8 +142,7 @@ The `PageHeader` component in the `en` folder might look like this:
```json
{
"heading": "Shwmae, bonjour, and hola!",
"description":
"Available in English, Welsh, French, and Spanish, with more translations coming soon. doopoll is great for local, multi-lingual, and global organisations."
"description": "Available in English, Welsh, French, and Spanish, with more translations coming soon. doopoll is great for local, multi-lingual, and global organisations."
}
```

Expand All @@ -152,8 +151,7 @@ And the `cy` component would look like this:
```json
{
"heading": "Shwmae, bonjour, a hola!",
"description":
"Ar gael yn Saesneg, Cymraeg, Ffrangeg a Sbaeneg, gyda rhagor o gyfieithiadau'n dod yn fuan. Mae doopoll yn wych ar gyfer sefydliadau lleol, amlieithog a byd-eang."
"description": "Ar gael yn Saesneg, Cymraeg, Ffrangeg a Sbaeneg, gyda rhagor o gyfieithiadau'n dod yn fuan. Mae doopoll yn wych ar gyfer sefydliadau lleol, amlieithog a byd-eang."
}
```

Expand Down
29 changes: 17 additions & 12 deletions docs/blog/2017-11-06-migrate-hugo-gatsby/index.md
Expand Up @@ -183,8 +183,8 @@ Add `gatsby-plugin-typography` and `typography-theme-moraga` (for example) and
In `src/utils/typograhy` add:

```javascript=
import Typography from 'typography';
import theme from 'typography-theme-moraga';
import Typography from "typography"
import theme from "typography-theme-moraga"
theme.overrideThemeStyles = () => {
return {
Expand All @@ -197,13 +197,13 @@ theme.overrideThemeStyles = () => {
left: `50%`,
transform: `translateX(-50%)`,
},
};
};
}
}
theme.baseFontSize = `22px`;
const typography = new Typography(theme);
theme.baseFontSize = `22px`
const typography = new Typography(theme)
module.exports = typography;
module.exports = typography
```

and start the project again to see:
Expand Down Expand Up @@ -406,11 +406,16 @@ collections: # A list of collections the CMS should be able to edit
create: true # Allow users to create new documents in this collection
slug: "{{slug}}"
fields: # The fields each document in this collection have
- {label: Title, name: "title", widget: "string", tagname: "h1"}
- {label: "Date", name: "date", widget: "datetime"}
- {label: Slug, name: "slug", widget: "string"}
- {label: Tags, name: tags, widget: list, default: ['APIs', 'JavaScript']}
- {label: "Body", name: "body", widget: "markdown"}
- { label: Title, name: "title", widget: "string", tagname: "h1" }
- { label: "Date", name: "date", widget: "datetime" }
- { label: Slug, name: "slug", widget: "string" }
- {
label: Tags,
name: tags,
widget: list,
default: ["APIs", "JavaScript"],
}
- { label: "Body", name: "body", widget: "markdown" }
```

The only interesting part is the `gatsby` branch which I used in parallel to the
Expand Down
Expand Up @@ -4,7 +4,16 @@ date: "2017-12-06"
author: "Josh Weaver"
image: "gatsby-contentful-netlify-algolia.jpg"
excerpt: "Gatsby has been getting a lot of recognition and adoption lately, and for good reason. It’s so flexible and it works well with nearly everything."
tags: ["contentful", "netlify", "algolia", "getting-started", "hosting", "ci", "performance"]
tags:
[
"contentful",
"netlify",
"algolia",
"getting-started",
"hosting",
"ci",
"performance",
]
---

Gatsby has been getting a lot of recognition and
Expand Down
Expand Up @@ -3,7 +3,7 @@ title: Announcing Gatsby v2 beta launch!
date: "2018-06-16"
author: "Mike Allanson"
tags: ["v2", "gatsby"]
image: 'astronaut-v2.jpg'
image: "astronaut-v2.jpg"
---

We’re excited to announce that today we shipped the first beta for Gatsby v2! 36 contributors have made over 300 commits to v2 since Gatsby v1 was released in July 2017.
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2018-08-09-swag-store/index.md
Expand Up @@ -3,7 +3,7 @@ title: Free Swag for Gatsby Contributors
date: "2018-08-09"
image: images/gatsby-swag.jpg
author: Jason Lengstorf
tags: ["collaboration","gatsby","community"]
tags: ["collaboration", "gatsby", "community"]
---

Today, we’re _so excited_ to announce the launch of the [Gatsby Swag Store][store]! If you’ve been following along [on Twitter][twitter], you may have seen the news a little while back.
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2018-08-11-gatsby-pair-programming/index.md
Expand Up @@ -3,7 +3,7 @@ title: My experience doing pair programming with the Gatsby team and why you sho
date: "2018-08-11"
image: images/screenshot.jpg
author: Horacio Herrera
tags: ["collaboration","gatsby","community"]
tags: ["collaboration", "gatsby", "community"]
---

I love pair programming. This is one of the practices we do in our trainings at [ReactJS Academy](https://reactjs.academy?utm_source=social&utm_medium=medium&utm_campaign=horacio-gatsby-post&utm_term=reactjs-academy), and we do it regularly at [LeanJS](https://leanjs.com?utm_source=social&utm_medium=medium&utm_campaign=horacio-gatsby-post&utm_term=leanjs).
Expand Down
Expand Up @@ -2,7 +2,7 @@
title: Using Decoupled Drupal with Gatsby
date: "2018-08-13"
author: Shannon Soper
tags: ["cms","gatsby","drupal"]
tags: ["cms", "gatsby", "drupal"]
---

## Why use Drupal + Gatsby together?
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/gatsby-v1.md
Expand Up @@ -2,7 +2,7 @@
title: "Announcing Gatsby 1.0.0 🎉🎉🎉"
date: "2017-07-06"
author: "Kyle Mathews"
image: 'images/container-ship-leaving.jpg'
image: "images/container-ship-leaving.jpg"
showImageInArticle: false
excerpt: Gatsby is your friendly, blazing fast static site generator for React. And after nearly a year of research, prototyping, and testing, Gatsby v1 is ready for action.
---
Expand Down

0 comments on commit dd1f13e

Please sign in to comment.