Created
December 31, 2018 14:55
-
-
Save brookslyrette/25b26615cb9c7add4c3be285fcc05180 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Link, graphql } from 'gatsby' | |
import Layout from '../components/layout' | |
import SEO from '../components/seo' | |
const IndexPage = ({ data }) => { | |
return ( | |
<Layout> | |
<SEO title="Home" keywords={[`gatsby`, `application`, `react`]} /> | |
<ul> | |
{data.allPostsJson.edges.map(post => ( | |
<li key={post.node.id}> | |
<Link to={post.node.slug}>{post.node.title}</Link> | |
</li> | |
))} | |
</ul> | |
</Layout> | |
) | |
} | |
export const query = graphql`{ | |
allPostsJson(sort: { fields: published_at, order: DESC }, filter: { status: { eq: "published" } }) { | |
edges { | |
node { | |
id, slug, title, published_at, status, markdown | |
} | |
} | |
} | |
}` | |
export default IndexPage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment