Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jan 25, 2018
1 parent 2aaf638 commit c7c95b0
Show file tree
Hide file tree
Showing 17 changed files with 196 additions and 154 deletions.
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ If you want your issue to be resolved quickly, please include in your issue:
changes you've made there.

## Contributing

We want contributing to Gatsby to be fun, enjoyable, and educational for anyone and everyone. Contributions go far beyond pull requests and commits; we are thrilled to receive a variety of other contributions including the following:

* Blogging, speaking about, or creating tutorials about one of Gatsby's many features. Mention @gatsbyjs on Twitter and/or email shannon [at] gatsbyjs [dot] com so we can give pointers and tips (if you want them :) and help you spread the word. Please add your blog posts and videos of talks to our [Awesome Gatsby](/docs/awesome-gatsby/) page.
Expand All @@ -29,17 +30,21 @@ If you are worried or don't know where to start, you can always reach out to Sha
Looking to speak about Gatsby? We'd love to review your talk abstract/CFP! You can email it to shannon [at] gatsbyjs [dot] com and we can give pointers or tips!!!

### Special Note on Issues

If an issue is affecting you, start at the top of this list and complete as many tasks on the list as you can:

1. If there is an issue, +1 the issue to indicate that it's affecting you
2. If there's an issue and you can add more detail, write a comment describing how the bug is affecting OR if you can, write up a work-around for the bug
3. If there's not an issue, write the most complete description of what's happening, preferably with link to a Gatsby site that reproduces the problem
4. Offer to help fix the bug (and it's totally expected that you ask for help; open-source maintainers want to help contributors)
5. Deliver a well-crafted, tested PR

### Creating your own plugins and loaders

If you create a loader or plugin, we would <3 for you to open source it, and put it on npm.

### Contributing to the repo

Gatsby uses a "monorepo" pattern to manage its many dependencies and relies on
lerna and yarn to configure the repository for active development.

Expand Down
20 changes: 11 additions & 9 deletions docs/blog/2018-01-22-getting-started-gatsby-and-wordpress/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on January 18, 2018._

Earlier this week I began rebuilding my blog using GatsbyJS + WordPress. As I familiarized with Gatsby, I found myself flipping through a million tabs, and I thought it might be useful to summarize concepts and to aggregate links I found helpful.

I recently decided to tackle a redo of my blog. I wanted to do something different and I've been hearing a lot about GatsbyJS. A static site generator for React that I can easily pull my existing WordPress data for? Sold. I'll try it.
I recently decided to tackle a redo of my blog. I wanted to do something different and I've been hearing a lot about GatsbyJS. A static site generator for React that I can easily pull my existing WordPress data for? Sold. I'll try it.

I generated a new site using the [default starter](https://github.com/gatsbyjs/gatsby-starter-default) and read through what it gave me. Assuming you have the [Gatsby CLI](/docs/) installed, run:

Expand All @@ -25,15 +25,16 @@ Essentially the Gatsby home base. The two things defined here initially (in the
```javascript
module.exports = {
siteMetadata: {
title: 'Gatsby Default Starter',
title: "Gatsby Default Starter",
},
plugins: ['gatsby-plugin-react-helmet'],
plugins: ["gatsby-plugin-react-helmet"],
};
```

See the [docs page on gatsby-config.js](/docs/gatsby-config/) for more.

For the curious:

* `gatsby-plugin-react-helmet` is a plugin the starter includes. It's a [document head manager for React](/packages/gatsby-plugin-react-helmet/).

##gatsby-node.js
Expand Down Expand Up @@ -93,21 +94,21 @@ I used the `gatsby-node.js` file from the plugin demo to get started. For my pur
For example, below is the part of the demo `gatsby-node.js` file that iterates over all the WordPress post data.

```javascript
const postTemplate = path.resolve(`./src/templates/post.js`)
const postTemplate = path.resolve(`./src/templates/post.js`);

_.each(result.data.allWordpressPost.edges, edge => {
createPage({
// will be the url for the page
path: edge.node.slug,
// specify the component template of your choice
component: slash(postTemplate),
// In the ^template's GraphQL query, 'id' will be available
// In the ^template's GraphQL query, 'id' will be available
// as a GraphQL variable to query for this posts's data.
context: {
id: edge.node.id,
}
})
})
id: edge.node.id,
},
});
});
```

The [docs define a Gatsby page](/docs/api-specification/#concepts) as "a site page with a pathname, a template component, and optional graphql query and layout component." See the docs on the [createPage bound action creator](/docs/bound-action-creators/#createPage) and [guide on creating and modifying pages for more detail](/docs/creating-and-modifying-pages/).
Expand All @@ -133,6 +134,7 @@ If you include the "optional GraphQL query" noted above, the result of that quer
While this isn't a tutorial -- more a guided walkthrough of me familiarizing and stepping through an initial Gatsby setup -- if you're following along with the [demo code](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-wordpress) you're probably close to (or already!) seeing your WordPress data populate your Gatsby dev site if you run `gatsby develop`!

##Sidenotes

1. You [don't need to know GraphQL](https://github.com/gatsbyjs/gatsby/issues/1172#issuecomment-308634739) to get started with Gatsby. I didn't. It's been a good introduction.
2. Gatsby makes heavy use of [plugins](/docs/plugins/) — both official and community — for a lot of things, from one that implements [Google Analytics](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-google-analytics), to one that adds [GitHub's accessibility error scanner](https://github.com/alampros/gatsby-plugin-accessibilityjs) to all pages.
3. Read through some of the source code. I particularly enjoyed reading through [the bootstrap process](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby/src/bootstrap/index.js). (It's beautifully commented).
Expand Down
Loading

0 comments on commit c7c95b0

Please sign in to comment.