Skip to content

Instantly share code, notes, and snippets.

@JacobKnaack
Created January 24, 2019 19:30
Show Gist options
  • Save JacobKnaack/258f38acc6d089ad6ee639dfae3fa87d to your computer and use it in GitHub Desktop.
Save JacobKnaack/258f38acc6d089ad6ee639dfae3fa87d to your computer and use it in GitHub Desktop.
Home page for gastby-docs
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