Skip to content

Commit

Permalink
Merge branch 'master' into internal-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Moocar committed Sep 6, 2018
2 parents 4be9afd + ee17ea7 commit 58fd41e
Show file tree
Hide file tree
Showing 175 changed files with 9,628 additions and 957 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/package.json
/package.json
40 changes: 20 additions & 20 deletions docs/blog/2017-07-19-creating-a-blog-with-gatsby/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ After installing each of these functional plugins, we'll edit
`gatsby-config.js`, which Gatsby loads at build-time to implement the exposed
functionality of the specified plugins.

```javascript{6-9}
```javascript{6-9}:title=gatsby-config.js
module.exports = {
siteMetadata: {
title: `Your Name - Blog`,
Expand Down Expand Up @@ -127,7 +127,7 @@ into our `gatsby-config.js`, like so:
yarn add gatsby-source-filesystem
```

```javascript{6-12}
```javascript{6-12}:title=gatsby-config.js
module.exports = {
// previous configuration
plugins: [
Expand Down Expand Up @@ -178,7 +178,7 @@ yarn add gatsby-transformer-remark

and editing `gatsby-config.js`

```javascript{13-18}
```javascript{13-18}:title=gatsby-config.js
module.exports = {
// previous setup
plugins: [
Expand Down Expand Up @@ -220,7 +220,7 @@ for blog posts is to name the folder something like `MM-DD-YYYY-title`, e.g.
The content of this Markdown file will be our blog post, authored in Markdown
(of course!). Here's what it'll look like:

```markdown
```markdown:title=src/pages/07-12-2017-getting-started/index.md
---
path: "/hello-world"
date: "2017-07-12T17:12:33.962Z"
Expand Down Expand Up @@ -252,7 +252,7 @@ write our template in... you guessed it, React! (Or
We'll want to create the file `src/templates/blog-post.js` (please create the
`src/templates` folder if it does not yet exist!).

```javascript
```javascript:title=src/templates/blog-post.js
import React from "react"
import Helmet from "react-helmet"

Expand Down Expand Up @@ -294,7 +294,7 @@ very simply the pieces of data that we want to display for our blog post. Each
piece of data our query selects will be injected via the `data` property we
specified earlier.

```javascript{21-32}
```javascript{23-32}:title=src/templates/blog-post.js
import React from "react"
import Helmet from "react-helmet"
import { graphql } from "gatsby"
Expand Down Expand Up @@ -376,11 +376,11 @@ level as `gatsby-config.js`. Each export found in this file will be parsed by
Gatsby, as detailed in its [Node API specification][node-spec]. However, we only
care about one particular API in this instance, `createPages`.

```javascript
```javascript:title=gatsby-node.js
const path = require("path")

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

const blogPostTemplate = path.resolve(`src/templates/blog-post.js`)
}
Expand All @@ -389,20 +389,20 @@ exports.createPages = ({ boundActionCreators, graphql }) => {
Nothing super complex yet! We're using the `createPages` API (which Gatsby will
call at build time with injected parameters). We're also grabbing the _path_ to
our blogPostTemplate we created earlier. Finally, we're using the `createPage`
action creator/function made available in boundActionCreators. Gatsby uses Redux
internally to manage its state, and `boundActionCreators` are simply the exposed
action creator/function made available in actions. Gatsby uses Redux
internally to manage its state, and `actions` are simply the exposed
action creators of Gatsby, of which `createPage` is one of the action creators!
For the full list of exposed action creators, check out [Gatsby's
documentation][gatsby-bound-action-creators]. We can now construct the GraphQL
documentation][gatsby-actions]. We can now construct the GraphQL
query, which will fetch all of our Markdown posts.

### Querying for posts

```javascript{8-31}
```javascript{8-31}:title=gatsby-node.js
const path = require("path")

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

const blogPostTemplate = path.resolve(`src/templates/blog-post.js`)

Expand Down Expand Up @@ -447,11 +447,11 @@ pages (with the `createPage` action creator). Let's do that!

### Creating the pages

```javascript{32-39}
```javascript{28-34}:title=gatsby-node.js
const path = require("path")

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

const blogPostTemplate = path.resolve(`src/templates/blog-post.js`)

Expand Down Expand Up @@ -531,7 +531,7 @@ component!) will get a corresponding static HTML file. For instance, if we
create `src/pages/tags.js`, the path `http://localhost:8000/tags/` will be
available within the browser and the statically generated site.

```javascript
```javascript:title=src/pages/index.js
import React from "react"
import { Link, graphql } from "gatsby"
import Helmet from "react-helmet"
Expand Down Expand Up @@ -649,7 +649,7 @@ Now go build something great.
[frontmatter]: https://jekyllrb.com/docs/frontmatter/
[learn-graphql]: https://www.howtographql.com
[node-spec]: /docs/node-apis/
[gatsby-bound-action-creators]: /docs/bound-action-creators/
[gatsby-actions]: /docs/actions/
[styled-components]: https://github.com/styled-components/styled-components
[yarn]: https://yarnpkg.com/en/
[source-code]: https://github.com/dschau/gatsby-blog-starter-kit
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/blog/2017-09-26-embracing-graphql/toa-heftiba-274947.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions docs/blog/2017-10-17-building-i18n-with-gatsby/index.md
Original file line number Diff line number Diff line change
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/blog/2018-1-18-strapi-and-gatsby/gatsby-article.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/blog/2018-1-18-strapi-and-gatsby/gatsby-author.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/blog/2018-1-18-strapi-and-gatsby/gatsby-home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/blog/2018-1-18-strapi-and-gatsby/strapi-permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/blog/2018-1-18-strapi-and-gatsby/strapi-register.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/blog/author.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
avatar: avatars/kyle-mathews.jpeg
twitter: "@kylemathews"
- id: Dustin Schau
bio: Consultant @ Object Partners, Inc. Likes all things front-end, and travel. And other things too. Blogs at dustinschau.com/blog.
bio: Software Engineer @ GatsbyJS. Likes all things front-end, and travel. And other things too. Blogs at blog.dustinschau.com.
avatar: avatars/dustin-schau.jpeg
twitter: "@schaudustin"
- id: Kostas Bariotis
Expand Down
Binary file modified docs/blog/gatsbygram-case-study/gatsbygram-instagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/blog/images/15009741473_9ced5e3209_o.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 5 additions & 6 deletions docs/docs/deploy-gatsby.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,17 @@ image: node:latest
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
- node_modules/

pages:
script:
- npm install
- ./node_modules/.bin/gatsby build --prefix-paths
- npm install
- ./node_modules/.bin/gatsby build --prefix-paths
artifacts:
paths:
- public
- public
only:
- master
- master
```
The CI platform uses Docker images/containers, so `image: node:latest` tells the
Expand Down Expand Up @@ -244,7 +244,6 @@ Add a `heroku-postbuild` script in your `package.json`:

```json
{
// ...
"scripts": {
// ...
Expand Down
8 changes: 8 additions & 0 deletions docs/docs/gatsby-starters.md
Original file line number Diff line number Diff line change
Expand Up @@ -963,3 +963,11 @@ gatsby new my-blog https://github.com/gatsbyjs/gatsby-starter-blog#v2
- Fully responsive
- Helper components for interacting with Sass classes
- Uses the latest version of React

- [gatsby-starter-typescript-sass](https://github.com/tdharmon/gatsby-starter-typescript-sass)
[(demo)](https://gatsby-starter-typescript-sass.netlify.com)

Features:

- Built upon gatsby-starter-default
- Perfect if you want to use Typescript and SASS but don't want any extra code
12 changes: 6 additions & 6 deletions docs/docs/how-gatsby-works-with-github-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ The easiest way to push a Gatsby app to GitHub Pages is by using a package calle
Add a `deploy` script to `package.json`

```json
{
"scripts": {
"deploy": "gatsby build --prefix-paths && gh-pages -d public",
}
}
{
"scripts": {
"deploy": "gatsby build --prefix-paths && gh-pages -d public"
}
}
```

The `--prefix-paths` flag is used because your website is inside a folder like `http://username.github.io/reponame/`, you'll need to add your `/reponame` path prefix as an option to `gatsby-config.js`:

```js
module.exports = {
pathPrefix: "/reponame"
pathPrefix: "/reponame",
}
```

Expand Down
Binary file modified docs/docs/images/gatsby-swag.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/network.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/docs/images/zipkin-trace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 1 addition & 27 deletions docs/docs/static-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,7 @@ export default () => (
)
```
Using `StaticQuery`, you can colocate a component with its data. No longer is it required to, say, pass data down from `Layout` to `Header`. It’s important that you write your query within the `StaticQuery` component, rather than referencing a variable from elsewhere. (Using queries will be added in the future; see [this issue](https://github.com/gatsbyjs/gatsby/issues/6545) for details.) For example, this won’t work:
```jsx
import React from "react"
import { StaticQuery, graphql } from "gatsby"
const query = graphql`
query HeadingQuery {
site {
siteMetadata {
title
}
}
}
`
export default () => (
<StaticQuery
query={query}
render={data => (
<header>
<h1>{data.site.siteMetadata.title}</h1>
</header>
)}
/>
)
```
Using `StaticQuery`, you can colocate a component with its data. No longer is it required to, say, pass data down from `Layout` to `Header`.
### Typechecking
Expand Down
3 changes: 1 addition & 2 deletions docs/docs/testing-components-with-graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ Here it is, trimmed to one node for brevity:
"edges": [
{
"node": {
"excerpt":
"Far far away, behind the word mountains, far from the countries Vokalia and\nConsonantia, there live the blind texts. Separated they live in…",
"excerpt": "Far far away, behind the word mountains, far from the countries Vokalia and\nConsonantia, there live the blind texts. Separated they live in…",
"fields": {
"slug": "/hi-folks/"
},
Expand Down
34 changes: 34 additions & 0 deletions docs/sites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2293,3 +2293,37 @@
built_by: Peter Kroyer
built_by_url: https://www.peterkroyer.at/
featured: false
- title: Geddski
main_url: https://gedd.ski
url: https://gedd.ski
description: >
Frontend mastery blog - level up your UI game.
categories:
- Web Dev
- CSS
- JavaScript
- Grid
- Flexbox
- PWA
- Productivity
- UI
- UX
built_by: Dave Geddes
built_by_url: https://twitter.com/geddski
featured: false
- title: Rung
main_url: 'https://rung.com.br/'
url: 'https://rung.com.br/'
description: >
Rung alerts you about the exceptionalities of your personal and professional life.
categories:
- API
- Technology
- Tool
- Software
- Corporate
- Help
- Services
- Travel
- Bot
featured: false
Loading

0 comments on commit 58fd41e

Please sign in to comment.