Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Edited pronouns to use second person pronouns #18962

Merged
merged 5 commits into from
Oct 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs/adding-a-list-of-markdown-blog-posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default IndexPage

### Creating the GraphQL query

Second, you need to provide the data to your component with a GraphQL query. Let's add it, so that `index.js` looks like this:
Second, you need to provide the data to your component with a GraphQL query. Add it, so that `index.js` looks like this:

```jsx:title=src/pages/index.js
import React from "react"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adding-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can also [roll your own comment system](/blog/2019-08-27-roll-your-own-comme

## Using Disqus for comments

In this guide, we'll show you how to implement Disqus on your blog as it has a number of nice features.
In this guide, you'll learn how to implement Disqus on your blog as it has a number of nice features.

- It is low maintenance, meaning [moderating your comments and maintaining your forum](https://help.disqus.com/moderation/moderating-101) less hassle.
- It provides official [React support](https://github.com/disqus/disqus-react).
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adding-forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Adding Forms

Gatsby is built on top of React. So anything that is possible with a React form is possible in Gatsby. Additional details about how to create React forms can be found in the [React forms documentation](https://reactjs.org/docs/forms.html) (which happens to be built with Gatsby!)

Let's start with the following page.
Start with the following page.

```jsx:title=src/pages/index.js
import React from "react"
Expand Down
16 changes: 8 additions & 8 deletions docs/docs/adding-search-with-algolia.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
}
```

Notice that you're loading `queries` from a file at `./src/utils/algolia.js` (you can of course put it wherever you like) and your Algolia ID and API key from `.env` so let's add those files.
Notice that you're loading `queries` from a file at `./src/utils/algolia.js` (you can of course put it wherever you like) and your Algolia ID and API key from `.env` so add those files.

For this, you will need to navigate to [the 'API Keys' section of your Algolia profile](https://www.algolia.com/api-keys). If you already have an account, you will find your API keys here. If not, you will need to sign up for one and then navigate to this link. It should look something like this screenshot, only with actual numbers instead of redacted ones:

Expand Down Expand Up @@ -161,9 +161,9 @@ If you've come this far, then the "backend" is done. You should now be able to r

## Adding a search interface to your site

Next, let's build a user-facing search interface for your site. It needs a way for the user to enter a search string, send that string to Algolia, receive matching results (_hits_ in Algolia speak) from your indices and finally display those to the user. Let's dive right in.
Next, build a user-facing search interface for your site. It needs a way for the user to enter a search string, send that string to Algolia, receive matching results (_hits_ in Algolia speak) from your indices and finally display those to the user.

You're going to assemble everything you need into a React `Search` component that you call from anywhere on your site where you want the user to be able to search. Even though design varies strongly from site to site, I'll also go through the styles implemented with [`styled-components`](https://styled-components.com) in this guide since working out the CSS transitions to have the search field slide out as the user clicks on it and the results pane to appear once Algolia returns matches took some time.
You're going to assemble everything you need into a React `Search` component that you call from anywhere on your site where you want the user to be able to search. Even though design varies strongly from site to site, you'll note the styles implemented with [`styled-components`](https://styled-components.com) in this guide since working out the CSS transitions to have the search field slide out as the user clicks on it and the results pane to appear once Algolia returns matches took some time.

The `Search` components is made up of the following files:

Expand All @@ -172,7 +172,7 @@ The `Search` components is made up of the following files:
- **`hitComps.js`**: the components that will render matching posts/pages
- **`styles.js`**: the styled components

There's quite a lot happening in these files so let's break them down one by one and piece by piece.
There's quite a lot happening in these files so break them down one by one and piece by piece.

### `index.js`

Expand Down Expand Up @@ -259,7 +259,7 @@ import { Root, SearchBox, HitsWrapper, PoweredBy } from "./styles"
import Input from "./Input"
```

`PoweredBy` renders the string "Powered by Algolia" with a small logo and link. If you're using Algolia's generous free tier, they ask you to acknowledge them in this way below the search results. `react-instantsearch-dom` also provides a [`PoweredBy` component](https://community.algolia.com/react-instantsearch/widgets/PoweredBy.html) specifically for this purpose but I preferred to build my own. You'll get back to these styled components once you're done with `index.js`. For now, let's move on.
`PoweredBy` renders the string "Powered by Algolia" with a small logo and link. If you're using Algolia's generous free tier, they ask you to acknowledge them in this way below the search results. `react-instantsearch-dom` also provides a [`PoweredBy` component](https://community.algolia.com/react-instantsearch/widgets/PoweredBy.html) specifically for this purpose, but you can build your own. You'll get back to these styled components once you're done with `index.js`.

The last thing you need for the `Search` component to work are hit components for every type of result you want to display to the user. The hit component determines how attributes of matching results (such as author, date, tags and title in the case of a blog post) are displayed to the user.

Expand Down Expand Up @@ -365,7 +365,7 @@ export default connectSearchBox(({ refine, ...rest }) => (

The `Input` component is where the user enters the search string. It is quite short since the grunt work is done by Algolia's [`connectSearchBox`](https://community.algolia.com/react-instantsearch/connectors/connectSearchBox.html) function.

Now let's look at the styled components `SearchIcon`, `Form`, `Input` as well as the ones imported in `index.js`.
Now look at the styled components `SearchIcon`, `Form`, `Input` as well as the ones imported in `index.js`.

## `styles.js`

Expand Down Expand Up @@ -503,7 +503,7 @@ export const PoweredBy = () => (
)
```

Styles will of course be different from one site to the next so I only list these components here for completeness and because they implement the dynamic behavior of the search interface, i.e. that the input field only slides out once the user clicks the `SearchIcon` (a magnifier) and that the pane displaying search (`HitsWrapper`) results only appears once Algolia's server returned matches, both of you which you might want to keep.
Styles will of course be different from one site to the next so these components are listed here for completeness and because they implement the dynamic behavior of the search interface, i.e. that the input field only slides out once the user clicks the `SearchIcon` (a magnifier) and that the pane displaying search (`HitsWrapper`) results only appears once Algolia's server returned matches, both of you which you might want to keep.

Now you're almost done, two small steps remain. First you need to put together a hit component for every type of result you want to display. In this example, these are blog posts and pages. And second, you need to call your `Search` component somewhere on your site. Here are the hit components.

Expand Down Expand Up @@ -557,7 +557,7 @@ export const PostHit = clickHandler => ({ hit }) => (

## Usage

Now all you need to do is import `Search` somewhere. The obvious place is the `Header` component so let's add it there.
Now all you need to do is import `Search` somewhere. The obvious place is the `Header` component so add it there.

```js:title=src/components/Header/index.js
import React from "react"
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adding-search-with-js-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Run `gatsby develop` and if all went well, open your browser of choice and enter

## JS-Search with a big dataset

Now let's try a different approach, this time instead of letting the component do all of the work, it's Gatsby's job to do that and pass all the data to a page defined by the path property, via [pageContext](/docs/behind-the-scenes-terminology/#pagecontext).
Now try a different approach, this time instead of letting the component do all of the work, it's Gatsby's job to do that and pass all the data to a page defined by the path property, via [pageContext](/docs/behind-the-scenes-terminology/#pagecontext).

To do this, some changes are required.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adding-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ See below for a list of guides in this section, or keep reading for an overview

## Site search overview

Before we go through the steps for adding search to your Gatsby website, let's examine the components needed for adding search to a website.
Before going through the steps for adding search to your Gatsby website, examine the components needed for adding search to a website.

There are three required components for adding search to your Gatsby website:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/audit-with-lighthouse.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Once this starts, you can now view your site at `localhost:9000`.

### Run a Lighthouse audit

Now let's run your first Lighthouse test.
Now run your first Lighthouse test.

1. Open the site in Chrome (if you didn't already do so) and then open up the Chrome DevTools.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/bulma.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $title-color: #ff0000;

The last step is to import the style and use it.

Let's replace the default contents of the index.js file.
Replace the default contents of the index.js file.

```javascript:title=index.js
import React from "react"
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/centralizing-your-sites-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ When executing this query within the GraphiQL editor you see output that looks s
}
```

Perfect! You now have a way of obtaining data from the `gatsby-config.js` file. Let's continue by pulling this data into the layout using the query you just formed.
Perfect! You now have a way of obtaining data from the `gatsby-config.js` file. Continue by pulling this data into the layout using the query you just formed.

### Pulling data inside the layout component

Inside your project, locate the `src/components` folder and navigate to the `layout.js` file. Within this layout component, you should notice a component named `StaticQuery`.

StaticQuery is a new component introduced in Gatsby V2, which allows you to run GraphQL queries within your components, not just pages. It allows developers to collocate data with their components.

Let's extend the query within this component to include the menu links, so it looks like so:
Extend the query within this component to include the menu links, so it looks like so:

```diff:title=src/components/layout.js
const Layout = ({ children }) => (
Expand Down Expand Up @@ -141,7 +141,7 @@ const Layout = ({ children }) => (

With the above changes to your `StaticQuery` component, the `render` property, which accepts a function that takes one argument, now has access to the menu links for use inside the function (as the argument). The last thing that is left to do is to display the site's navigation.

To do this, the header component that is already available in the project seems like it might be a good starting place to display the navigation. Let's pass the `menuLinks` object to this header component like so:
To do this, the header component that is already available in the project seems like it might be a good starting place to display the navigation. Pass the `menuLinks` object to this header component like so:

```diff:title=src/components/layout.js
const Layout = ({ children }) => (
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/creating-a-source-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ When an object node is deleted, Gatsby _does not_ delete any referenced entities

#### Creating the relationship

Let's say you want to create a relationship between Posts and Authors, and let's say you want to call the field `author`.
Suppose you want to create a relationship between Posts and Authors, and you want to call the field `author`.

Before you pass the Post object and Author object into `createNode` and create the respective nodes, you need to create a field called `author___NODE` on the Post object to hold the relationship to Authors. The value of this field should be the node ID of the Author.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/debugging-async-lifecycles.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Debugging Asynchronous Lifecycle Methods

Various lifecycle methods (see: [Gatsby Node APIs](/docs/node-apis/)) within Gatsby are presumed to be asynchronous. In other words, these methods can _eventually_ resolve to a value and this value is a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise). You wait for the `Promise` to resolve, and then mark the lifecycle method as completed when it does.

In the context of Gatsby, this means that if you are invoking asynchronous functionality (e.g. data requests, `graphql` calls, etc.) and not correctly returning the Promise an internal issue can arise where the result of those call(s) happens _after_ the lifecycle method has already been marked as completed. Let's consider an example:
In the context of Gatsby, this means that if you are invoking asynchronous functionality (e.g. data requests, `graphql` calls, etc.) and not correctly returning the Promise an internal issue can arise where the result of those call(s) happens _after_ the lifecycle method has already been marked as completed. Consider an example:

```js:title=gatsby-node.js
exports.createPages = async function({ actions, graphql }) {
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/debugging-the-build-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In this guide you will learn how to debug some code using:
- [VS Code debugger (Manual-Config)](#vs-code-debugger-manual-config)
- [Chrome DevTools for Node](#chrome-devtools-for-node)

As an example let's use the following code snippet in a `gatsby-node.js` file:
As an example, use the following code snippet in a `gatsby-node.js` file:

```js:title=gatsby-node.js
const { createFilePath } = require("gatsby-source-filesystem")
Expand Down Expand Up @@ -124,13 +124,13 @@ You should see Chrome DevTools start and that code execution is paused at the st

Right now you can't see your files in Sources. You need to add those using the "Add folder to workspace" button and pick the directory with the code you want to debug. If you want to debug code in your `gatsby-node.js` or your local plugins, pick your project directory. If you want debug the `gatsby` package you will have to pick the `gatsby` directory inside `node_modules`.

This example has problematic code in your local `gatsby-node.js` file, so let's add the directory containing it to Sources. You should have a directory with your code in the left pane:
This example has problematic code in your local `gatsby-node.js` file, so add the directory containing it to Sources. You should have a directory with your code in the left pane:

![Files added to Sources tab](./images/chrome-devtools-files.png)

### Using DevTools

Let's go ahead and add a breakpoint just before the place that the error is thrown. To add a breakpoint navigate to `gatsby-node.js` and left click on a line number:
Go ahead and add a breakpoint just before the place that the error is thrown. To add a breakpoint navigate to `gatsby-node.js` and left click on a line number:

![Added breakpoint](./images/chrome-devtools-new-breakpoint.png)

Expand All @@ -140,7 +140,7 @@ Now you can resume code execution by clicking the "resume" icon in the DevTools

To inspect variables you can hover your mouse over them or go to the `Scope` section in the right-hand pane (either collapse the "Call Stack" section or scroll through it to the bottom).

In the example `Node` is `undefined` and to figure out why, let's go backwards. `Node` is extracted from `args` so let's examine that by hovering `args`:
In the example `Node` is `undefined` and to figure out why, let's go backwards. `Node` is extracted from `args` so examine that by hovering `args`:

![Examine variable](./images/chrome-devtools-examine-var.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/emotion.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {

Then in your terminal run `npm start` to start the Gatsby development server.

Now let's create a sample Emotion page at `src/pages/index.js`:
Now create a sample Emotion page at `src/pages/index.js`:

```jsx:title=src/pages/index.js
import React from "react"
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ title: Environment Variables
You can provide environment variables to your site to customise its behavior in different environments.

Environment variables can be distinguished between different types.
There are environment variables that are defined in special places intended to be used in different deployment environments. Let's call these “Project Env Vars”.
And there are true OS-level environment variables that might be used in command-line calls. Let's call these “OS Env Vars”.
There are environment variables that are defined in special places intended to be used in different deployment environments. You can call these “Project Env Vars”.
And there are true OS-level environment variables that might be used in command-line calls. You can call these “OS Env Vars”.

In both cases you want to be able to access the relevant value of these variables for the environment you are in.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/graphql-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For more information, read about [why Gatsby uses GraphQL](/docs/why-gatsby-uses

## Basic query

Let's start with the basics, pulling up the site `title` from your `gatsby-config.js`'s `siteMetaData`. Here the query is on the left and the results are on the right.
Start with the basics, pulling up the site `title` from your `gatsby-config.js`'s `siteMetaData`. Here the query is on the left and the results are on the right.

<iframe title="A basic query" src="https://711808k40x.sse.codesandbox.io/___graphql?query=%7B%0A%20%20site%20%7B%0A%20%20%20%20siteMetadata%20%7B%0A%20%20%20%20%20%20title%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&explorerIsOpen=false" width="600" height="400"></iframe>

Expand Down Expand Up @@ -142,7 +142,7 @@ To add variables to page component queries, pass these in the `context` object [

You can also group values on the basis of a field e.g. the title, date or category and get the field value, the total number of occurrences and edges.

The query below gets us all categories (`fieldValue`) applied to a book and how many books (`totalCount`) a given category is applied to. In addition we're grabbing the `title` of books in a given category. You can see for example that there are 3 books in the `magical creatures` category.
The query below gets you all categories (`fieldValue`) applied to a book and how many books (`totalCount`) a given category is applied to. In addition you are grabbing the `title` of books in a given category. You can see for example that there are 3 books in the `magical creatures` category.

<iframe title="Grouping values" src="https://711808k40x.sse.codesandbox.io/___graphql?query=%7B%0A%20%20allMarkdownRemark(filter%3A%20%7Bfrontmatter%3A%20%7Btitle%3A%20%7Bne%3A%20%22%22%7D%7D%7D)%20%7B%0A%20%20%20%20group(field%3A%20frontmatter___categories)%20%7B%0A%20%20%20%20%20%20fieldValue%0A%20%20%20%20%20%20totalCount%0A%20%20%20%20%20%20edges%20%7B%0A%20%20%20%20%20%20%20%20node%20%7B%0A%20%20%20%20%20%20%20%20%20%20frontmatter%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20title%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20nodes%20%7B%0A%20%20%20%20%20%20frontmatter%20%7B%0A%20%20%20%20%20%20%20%20title%0A%20%20%20%20%20%20%20%20categories%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&explorerIsOpen=false" width="600" height="400"></iframe>

Expand Down
Loading