Created
January 24, 2019 19:30
-
-
Save JacobKnaack/258f38acc6d089ad6ee639dfae3fa87d to your computer and use it in GitHub Desktop.
Home page for gastby-docs
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 PropTypes from 'prop-types' | |
import { graphql } from 'gatsby' | |
import Layout from '../components/layout' | |
import SEO from '../components/seo' | |
import Docs from '../components/docs' | |
const IndexPage = ({ data, pageContext }) => { | |
return ( | |
<Layout> | |
<SEO | |
title="Home" | |
keywords={[ | |
`gatsby`, | |
`application`, | |
`react`, | |
'documentation', | |
'docs', | |
'markdown', | |
]} | |
/> | |
<Docs docs={data.docs.objectsByType} pageContext={pageContext} /> | |
</Layout> | |
) | |
} | |
IndexPage.propTypes = { | |
data: PropTypes.object, | |
pageContext: PropTypes.object, | |
} | |
export const query = graphql` | |
query($cosmicBucket: String!, $readKey: String!) { | |
docs { | |
objectsByType( | |
bucket_slug: $cosmicBucket | |
type_slug: "docs" | |
read_key: $readKey | |
) { | |
title | |
content | |
created_at | |
_id | |
} | |
} | |
} | |
` | |
export default IndexPage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment