text: import React from "react"
  import Helmet from 'react-helmet';
  import { graphql } from 'gatsby'
  import Layout from "../components/layout"
  import PostLink from "../components/post-link"
  import HeroHeader from "../components/heroHeader"
  
  const IndexPage = ({
    data: {
      site,
      allMarkdownRemark: { edges },
    },
  }) => {
  
    const Posts = edges
      .slice(0,6)
      .map((edge, ind) => <PostLink key={edge.node.id} post={edge.node} ind={ind}/>)
  
    return (
      <Layout>
        <Helmet>
          <title>{site.siteMetadata.title}</title>
          <meta name="description" content={site.siteMetadata.description} />
        </Helmet>
        <HeroHeader/>
        <h2>Most Recent &darr;</h2>
        <div className="grids">
          {Posts}
        </div>
      </Layout>
    )
  }
  
  export default IndexPage
  export const pageQuery = graphql`
    query indexPageQuery {
      site {
        siteMetadata {
          title
          description
        }
      }
      allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }) {
        edges {
          node {
            id
            excerpt(pruneLength: 250)
            frontmatter {
              date(formatString: "MMMM DD, YYYY")
              path
              title
              thumbnail
            }
          }
        }
      }
    }
  `
  