text: import React from "react"
  import { Link } from "gatsby"
  
  import Layout from "../components/layout"
  import SEO from "../components/seo"
  import { graphql } from "gatsby"
  
  const IndexPage = props => {
    const { data } = props
    console.log("props", props)
    return (
      <Layout>
        <SEO title="Home" keywords={[`gatsby`, `application`, `react`]} />
        <h1>Hi people</h1>
        <p>Welcome to your new Gatsby site.</p>
  
        {data.allMarkdownRemark.edges.map(({ node }, i) => {
          return (
            <Link to={node.fields.slug} className="link">
              <div className="post-list">
                <h1>{node.frontmatter.title}</h1>
                <span>{node.frontmatter.date}</span>
                <p>{node.excerpt}</p>
              </div>
            </Link>
          )
        })}
        <Link to="/page-2/">Go to page 2</Link>
      </Layout>
    )
  }
  
  export const query = graphql`
    query IndexPageQuery {
      allMarkdownRemark(limit: 10) {
        edges {
          node {
            frontmatter {
              title
              description
              date
            }
            fields {
              slug
            }
          }
        }
      }
    }
  `
  export default IndexPage
  