Skip to content

Commit

Permalink
Update index.md (gatsbyjs#10306)
Browse files Browse the repository at this point in the history
Update imports statements to reflect `emotion/core` instead of `react-emotion` and the commensurate use of `css` property rather than `className`. Also added an explanatory note on the `graphql` sort statement that there are three underscores, instead of two, which the eyes might only see.

<!--
  Q. Which branch should I use for my pull request?
  A. Your best bet is to go for `master`. If you are unsure, ask in the PR, and a Gatsby mantainer will be happy to help :)

  Note: We will only accept bug fixes for Gatsby v1. New features should be added to Gatsby v2.

  Learn more about contributing: https://www.gatsbyjs.org/docs/how-to-contribute/
-->
  • Loading branch information
wesleylhandy authored and gpetrioli committed Jan 22, 2019
1 parent e846479 commit 3f30de7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/tutorial/part-six/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ the following to add a GraphQL query with some initial HTML and styling.
```jsx:title=src/pages/index.js
import React from "react"
import { graphql } from "gatsby"
import { css } from "react-emotion"
import { css } from "@emotion/core"
import { rhythm } from "../utils/typography"
import Layout from "../components/layout"

Expand All @@ -117,7 +117,7 @@ export default ({ data }) => {
<Layout>
<div>
<h1
className={css`
css={css`
display: inline-block;
border-bottom: 1px solid;
`}
Expand All @@ -128,13 +128,13 @@ export default ({ data }) => {
{data.allMarkdownRemark.edges.map(({ node }) => (
<div key={node.id}>
<h3
className={css`
css={css`
margin-bottom: ${rhythm(1 / 4)};
`}
>
{node.frontmatter.title}{" "}
<span
className={css`
css={css`
color: #bbb;
`}
>
Expand Down Expand Up @@ -198,7 +198,7 @@ this powerful set of operators, you can select any data you want—in the format
need.

In your index page's GraphQL query, change `allMarkdownRemark` to
`allMarkdownRemark(sort: { fields: [frontmatter___date], order: DESC })`. Save
`allMarkdownRemark(sort: { fields: [frontmatter___date], order: DESC })`. _Note: There are 3 underscores between `frontmatter` and `date`._ Save
this and the sort order should be fixed.

Try opening Graph_i_QL and playing with different sort options. You can sort the
Expand Down

0 comments on commit 3f30de7

Please sign in to comment.