text: import React from "react"
  import { Link } from "gatsby"
  
  import Layout from "../components/layout"
  
  const IndexPage = ({ data }) => (
    <Layout>
      <h1>Hello, Everyone!</h1>
      {data.allMarkdownRemark.edges.map(({ node }) => (
        <article key={node.frontmatter.slug}>
          <h2>
            <Link to={`/${node.frontmatter.slug}`}>
              {node.frontmatter.title}
            </Link>
          </h2>
          <time dateTime={node.frontmatter.date}>{node.frontmatter.date}</time>
          <p>{node.excerpt}</p>
        </article>
      ))}
    </Layout>
  )
  
  export const query = graphql`
    query {
      allMarkdownRemark(sort: { fields: [frontmatter___date], order: DESC })  {
        edges {
          node {
            frontmatter {
              title
              date(formatString: "YYYY年MM月DD日")
              slug
            }
            excerpt
          }
        }
      }
    }
  `
  
  export default IndexPage