{"size": 1311, "ext": "js", "max_stars_repo_path": "src/templates/index.js", "max_stars_repo_name": "risan/blog.risanb.com", "max_stars_repo_stars_event_min_datetime": "2021-05-19T21:24:09.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-19T21:24:09.000Z", "max_issues_repo_path": "src/templates/index.js", "max_issues_repo_name": "risan/blog.risanb.com", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/templates/index.js", "max_forks_repo_name": "risan/blog.risanb.com", "max_forks_repo_forks_event_min_datetime": "2019-05-27T12:32:34.000Z", "max_forks_repo_forks_event_max_datetime": "2019-05-27T12:32:34.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 23.0, "max_line_length": 58, "alphanum_fraction": 0.5118230359}
import React from 'react';
import { graphql } from 'gatsby';
import Layout from '../components/Layout';
import PostList from '../components/PostList';
import Pagination from '../components/Pagination';

export default ({ data, pageContext }) => (
  <Layout
    title={
      pageContext.page === 1
        ? `Blog Risan Bagja`
        : `Blog Risan Bagja - Halaman ${pageContext.page}`
    }
    slug={pageContext.page === 1 ? '' : pageContext.slug}
    disableTitleTemplate
  >
    <PostList items={data.allMarkdownRemark.nodes} />
    <Pagination {...pageContext} />
  </Layout>
);

export const query = graphql`
  query($skip: Int!, $limit: Int!) {
    allMarkdownRemark(
      sort: { fields: frontmatter___date, order: DESC }
      skip: $skip
      limit: $limit
    ) {
      nodes {
        fields {
          slug
        }
        frontmatter {
          title
          date
          tags
          image {
            childImageSharp {
              fluid(
                maxWidth: 300
                maxHeight: 180
                cropFocus: CENTER
                quality: 70
                srcSetBreakpoints: [575]
              ) {
                ...GatsbyImageSharpFluid_tracedSVG
              }
            }
          }
        }
        excerpt
        timeToRead
      }
    }
  }
`;
