Skip to content

Commit

Permalink
fix(docs): apply redirect - fix anchor link (#20760)
Browse files Browse the repository at this point in the history
* apply redirect - fix anchore link

* solve merge conflicts - part 2
  • Loading branch information
muescha committed Feb 18, 2020
1 parent 53084b9 commit 9ea0453
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = {

## Use the data to dynamically construct pages

Once your source plugin is pulling data, you can construct your site pages by implementing the `createPages` API in `gatsby-node.js`. When this is called, your data has already been fetched and is available to query with GraphQL. Gatsby uses [GraphQL at build time](/docs/querying-with-graphql/#how-does-graphql-and-gatsby-work-together); Your source plugin (in this case, `gatsby-source-wordpress`) fetches your data, and Gatsby uses that data to "[automatically _infer_ a GraphQL schema](/docs/querying-with-graphql/#how-does-graphql-and-gatsby-work-together)" that you can query against.
Once your source plugin is pulling data, you can construct your site pages by implementing the `createPages` API in `gatsby-node.js`. When this is called, your data has already been fetched and is available to query with GraphQL. Gatsby uses [GraphQL at build time](/docs/graphql-concepts/#how-do-graphql-and-gatsby-work-together); Your source plugin (in this case, `gatsby-source-wordpress`) fetches your data, and Gatsby uses that data to "[automatically _infer_ a GraphQL schema](/docs/graphql-concepts/#how-does-graphql-and-gatsby-work-together)" that you can query against.

The `createPages` API exposes the `graphql` function:

Expand Down Expand Up @@ -129,7 +129,7 @@ So a template is a page component that we can use to programmatically create pag
React components living in `src/pages` automatically become pages. The file name of a page maps to its site path. My site in its current state only has one good example of this — `src/pages/index.js` maps to [amberley.blog](https://amberley.blog/). If I had an 'about' page, it would live at `src/pages/about.js`, and map to [amberley.blog/about](https://amberley.blog/about). (Since that doesn't exist, it will actually end up hitting the only other page currently defined in my site, which is `src/pages/404.js` — ([read about 404 pages](/docs/add-404-page/)).

If you include the "optional GraphQL query" noted above, the result of that query is automatically passed to the component on a `data` prop (`this.props.data`). ([Read more on GraphQL queries](/docs/querying-with-graphql/#what-does-a-graphql-query-look-like)).
If you include the "optional GraphQL query" noted above, the result of that query is automatically passed to the component on a `data` prop (`this.props.data`). ([Read more on GraphQL queries](/docs/graphql-concepts/#what-does-a-graphql-query-look-like)).

## Onward

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2018-05-11-six-reasons-i-chose-gatsby/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ One of the first things about Gatsby that impressed me was its plugin system. Li

With any website, one needs to have data/content injected into markup to generate HTML. With static site generators, this usually involves writing Markdown files adjacent to template files that get merged together in some way at build time. Gatsby takes a different approach by providing a data fetching abstraction layer between your data/content and your templates. This brings about a huge paradigm shift both in how data is accessed in the templates as well as from where data can be pulled (we'll look at the latter in reason #4).

With Gatsby, the entirety of your site's data is accessed via a local [GraphQL](https://graphql.org/) API. If you've never worked with GraphQL before, that's okay; Gatsby's docs [walk you through the process](/docs/querying-with-graphql/). In your page templates, you can specify the data you require for that page as a GraphQL query. Then, when Gatsby's build process runs, it analyzes the query and provides the requested data to the template. Future versions of Gatsby will also let you do this at the component level as well. This allows you to build up your templates using the React's normal component paradigm.
With Gatsby, the entirety of your site's data is accessed via a local [GraphQL](https://graphql.org/) API. If you've never worked with GraphQL before, that's okay; Gatsby's docs [walk you through the process](/docs/graphql-concepts/). In your page templates, you can specify the data you require for that page as a GraphQL query. Then, when Gatsby's build process runs, it analyzes the query and provides the requested data to the template. Future versions of Gatsby will also let you do this at the component level as well. This allows you to build up your templates using the React's normal component paradigm.

## #4: Multiple data sources

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2018-10-25-using-gatsby-without-graphql/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Using Gatsby's data layer provides the following benefits:
- Improves performance by removing data bloat — GraphQL enables you to select only the data you need, not whatever an API returns
- Enables you to take advantage of hot reloading when developing; For example, in this post's example "Pokémon" site, if you wanted to add a "see other pokémon" section to the pokémon detail view, you would need to change your `gatsby-node.js` to pass all pokémon to to the page, and restart the dev server. In contrast, when using queries, you can add a query and it will hot reload.

> Learn more about [GraphQL in Gatsby](/docs/querying-with-graphql/).
> Learn more about [GraphQL in Gatsby](/docs/graphql-concepts/).
Working outside of the data layer also means foregoing the optimizations provided by transformer plugins, like:

Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2018-11-07-gatsby-for-apps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ We can't wait to see what you build.
[prpl]: https://developers.google.com/web/fundamentals/performance/prpl-pattern/
[app-shell]: https://developers.google.com/web/fundamentals/architecture/app-shell
[case-study]: https://developers.google.com/web/showcase/2017/twitter
[gatsby-graphql]: /docs/querying-with-graphql/
[gatsby-graphql]: /docs/graphql-concepts/
[gatsby-without-graphql]: /docs/using-gatsby-without-graphql/
[authentication-data]: /tutorial/authentication-tutorial/
[client-only-routes]: /docs/client-only-routes-and-user-authentication
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/adding-pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pagination is the technique of spreading that content across multiple pages.

The goal of pagination is to create multiple pages (from a single [template](/docs/building-with-components/#page-template-components)) that show a limited number of items.

Each page will [query GraphQL](/docs/querying-with-graphql/) for those specific items.
Each page will [query GraphQL](/docs/graphql-concepts/) for those specific items.

The information needed to query for those specific items (i.e. values for [`limit`](/docs/graphql-reference/#limit) and [`skip`](/docs/graphql-reference/#skip)) will come from the [`context`](/docs/graphql-reference/#query-variables) that is added when [creating pages](/docs/creating-and-modifying-pages/#creating-pages-in-gatsby-nodejs) in `gatsby-node`.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Which returns this:

Notice how the query signature exactly matches the returned JSON signature. This is possible because in GraphQL, you query against a `schema` that is the representation of your available data. Don't worry about where the schema comes from right now, Gatsby takes care of organizing all of your data for you and making it discoverable with a tool called GraphiQL. GraphiQL is a UI that lets you 1) run queries against your data in the browser, and 2) dig into the structure of data available to you through a data type explorer.

If you want to know more about GraphQL, you can read more about [why Gatsby uses it](/docs/why-gatsby-uses-graphql/) and check out this [conceptual guide](/docs/querying-with-graphql/) on querying data with GraphQL.
If you want to know more about GraphQL, you can read more about [why Gatsby uses it](/docs/why-gatsby-uses-graphql/) and check out this [conceptual guide](/docs/graphql-concepts/) on querying data with GraphQL.

<GuideList slug={props.slug} />
2 changes: 1 addition & 1 deletion docs/docs/porting-from-create-react-app-to-gatsby.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Gatsby still works with all the `react` packages running in a Create React App p

### Unified GraphQL data layer

Plugins can also pull in data from any number of sources like APIs, CMSs, or the filesystem. That data is combined into a unified data layer that you can [query with GraphQL](/docs/querying-with-graphql/) throughout your app.
Plugins can also pull in data from any number of sources like APIs, CMSs, or the filesystem. That data is combined into a unified data layer that you can [query with GraphQL](/docs/graphql-concepts/) throughout your app.

This data layer simplifies the process of pulling data from different sources and providing them in your pages and components. This combination of data from different sources stitched together in a modern workflow is referred to as [the content mesh](/blog/2018-10-04-journey-to-the-content-mesh/).

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/recipes/sourcing-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Data sourcing in Gatsby is plugin-driven; Source plugins fetch data from their s

## Adding data to GraphQL

Gatsby's [GraphQL data layer](/docs/querying-with-graphql/) uses nodes to model chunks of data. Gatsby source plugins add source nodes that you can query for, but you can also create source nodes yourself. To add custom data to the GraphQL data layer yourself, Gatsby provides methods you can leverage.
Gatsby's [GraphQL data layer](/docs/graphql-concepts/) uses nodes to model chunks of data. Gatsby source plugins add source nodes that you can query for, but you can also create source nodes yourself. To add custom data to the GraphQL data layer yourself, Gatsby provides methods you can leverage.

This recipe shows you how to add custom data using `createNode()`.

Expand Down Expand Up @@ -533,7 +533,7 @@ export default ({ pageContext: { allPokemon } }) => (

- [Full Pokemon data repo](https://github.com/jlengstorf/gatsby-with-unstructured-data/)
- More on using unstructured data in [Using Gatsby without GraphQL](/docs/using-gatsby-without-graphql/)
- When and how to [query data with GraphQL](/docs/querying-with-graphql/) for more complex Gatsby sites
- When and how to [query data with GraphQL](/docs/graphql-concepts/) for more complex Gatsby sites

## Sourcing content from Drupal

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

## Using WordPress data

Once your source plugin is pulling data, you can construct your site pages by implementing the `createPages` API in `gatsby-node.js`. When this is called, your data has already been fetched and is available to query with GraphQL. Gatsby uses [GraphQL at build time](/docs/querying-with-graphql/#how-does-graphql-and-gatsby-work-together); Your source plugin (in this case, `gatsby-source-wordpress`) fetches your data, and Gatsby uses that data to "[automatically _infer_ a GraphQL schema](/docs/querying-with-graphql/#how-does-graphql-and-gatsby-work-together)" that you can query against.
Once your source plugin is pulling data, you can construct your site pages by implementing the `createPages` API in `gatsby-node.js`. When this is called, your data has already been fetched and is available to query with GraphQL. Gatsby uses [GraphQL at build time](/docs/graphql-concepts/#how-do-graphql-and-gatsby-work-together); Your source plugin (in this case, `gatsby-source-wordpress`) fetches your data, and Gatsby uses that data to "[automatically _infer_ a GraphQL schema](/docs/graphql-concepts/#how-does-graphql-and-gatsby-work-together)" that you can query against.

The `createPages` API exposes the `graphql` function:

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/using-graphql-fragments.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ A fragment consists of three components:

## Creating and using a fragment

A fragment can be created inside any GraphQL query, but it's good practice to create the query separately. More organization advice in the [Conceptual Guide](/docs/querying-with-graphql/#fragments).
A fragment can be created inside any GraphQL query, but it's good practice to create the query separately. More organization advice in the [Conceptual Guide](/docs/graphql-concepts/#fragments).

```jsx:title=src/components/IndexPost.jsx
import React from "react"
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/working-with-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ title: Working with Images in Gatsby

Optimizing images is a challenge on any website. To utilize best practices for performance across devices, you need multiple sizes and resolutions of each image. Luckily, Gatsby has several useful [plugins](/docs/plugins/) that work together to do that for images on [page components](/docs/building-with-components/#page-components).

The recommended approach is to use [GraphQL queries](/docs/querying-with-graphql/) to get images of the optimal size or resolution, then, display them with the [`gatsby-image`](/packages/gatsby-image/) component.
The recommended approach is to use [GraphQL queries](/docs/graphql-concepts/) to get images of the optimal size or resolution, then, display them with the [`gatsby-image`](/packages/gatsby-image/) component.

## Query images with GraphQL

Querying images with GraphQL allows you to access the image's data as well as perform transformations with [Sharp](https://github.com/lovell/sharp), a high-performance image processing library.

You'll need a few plugins for this:

- [`gatsby-source-filesystem`](/packages/gatsby-source-filesystem/) plugin allows you to [query files with GraphQL](/docs/querying-with-graphql/#images)
- [`gatsby-source-filesystem`](/packages/gatsby-source-filesystem/) plugin allows you to [query files with GraphQL](/docs/graphql-concepts/#images)
- [`gatsby-plugin-sharp`](/packages/gatsby-plugin-sharp) powers the connections between Sharp and Gatsby Plugins
- [`gatsby-transformer-sharp`](/packages/gatsby-transformer-sharp/) allows you to create multiples images of the right sizes and resolutions with a query

Expand Down

0 comments on commit 9ea0453

Please sign in to comment.