diff --git a/src/components/Image.jsx b/src/components/Image.jsx deleted file mode 100755 index 70b81723..00000000 --- a/src/components/Image.jsx +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react' -import { StaticQuery, graphql } from 'gatsby' -import Img from 'gatsby-image' - -/* - * This component is built using `gatsby-image` to automatically serve optimized - * images with lazy loading and reduced file sizes. The image is loaded using a - * `StaticQuery`, which allows us to load the image from directly within this - * component, rather than having to pass the image data down from pages. - * - * For more information, see the docs: - * - `gatsby-image`: https://gatsby.app/gatsby-image - * - `StaticQuery`: https://gatsby.app/staticquery - */ - -const Image = () => ( - ( - - )} - /> -) -export default Image diff --git a/src/pages/index.js b/src/pages/index.js index 2f55d145..99f41527 100755 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,15 +1,53 @@ import React from 'react' - +import PropTypes from 'prop-types' +import { Link, graphql } from 'gatsby' import Layout from '../components/Layout' -import Image from '../components/Image' -const IndexPage = () => ( - -

Hi people

-

Welcome to your new Gatsby site.

-

Now go build something great.

- -
-) +const IndexPage = ({ data, location }) => { + const { edges } = data.allMarkdownRemark + + const DocsList = edges.map(({ node }) => { + const { title } = node.frontmatter + const { slug } = node.fields + + return ( +
  • + {title} +
  • + ) + }) + + return ( + +

    Hi there

    + +
    + ) +} + +IndexPage.propTypes = { + data: PropTypes.object.isRequired, + location: PropTypes.object.isRequired +} export default IndexPage + +export const indexQuery = graphql` + query { + allMarkdownRemark { + edges { + node { + id + html + excerpt(pruneLength: 250) + frontmatter { + title + } + fields { + slug + } + } + } + } + } +`