{"size": 1002, "ext": "js", "max_stars_repo_path": "src/pages/index.js", "max_stars_repo_name": "kietitpro/intro-gatsby", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/pages/index.js", "max_issues_repo_name": "kietitpro/intro-gatsby", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/pages/index.js", "max_forks_repo_name": "kietitpro/intro-gatsby", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.2666666667, "max_line_length": 74, "alphanum_fraction": 0.5379241517}
import React from "react"
import { Link } from "gatsby"
import {graphql} from "gatsby"

import Layout from "../components/layout"
import Image from "../components/image"
import SEO from "../components/seo"

export const query = graphql`
  {
    allMarkdownRemark(sort: {fields: frontmatter___data, order: DESC}) {
      edges {
        node {
          frontmatter {
            data(formatString: "YYYY MMMM DD")
            title
          }
          html
        }
      }
    }
  }
`

const IndexPage = ({data}) => (
  <Layout>
    <SEO title="Home" />
    {
      data.allMarkdownRemark.edges.map((item,i) => {
        return (
          <div key={i}>
            <h1>{item.node.frontmatter.title}</h1>
            <h1>{item.node.frontmatter.data}</h1>
            <div dangerouslySetInnerHTML={{__html: item.node.html}}></div>
            <hr style={{height: "3px"}}/>
          </div>
        )
      })
    }
    <Link to="/page-2/">Go to page 2</Link>
  </Layout>
)

export default IndexPage
