<commit_before>import React from 'react'
import styled from 'styled-components'
import { Grid } from 'grid-styled'
import { navigateTo } from 'gatsby-link'

import PostEntry from '@/components/postEntry'

const LearningPage = styled.div`
  min-height: 100%;
  padding: 0.5em;
  background: ${props => props.theme.color.bg};
`

const Card = styled(Grid)`
  padding: 0.5em;
  height: 16em;
  cursor: pointer;

  a {
    color: ${props => props.theme.color.base};
    text-decoration: none;
  }
`

export default function Learning({ data }) {
  const posts = data.allMarkdownRemark.edges.map(({ node }) => {
    const { frontmatter } = node
    const excerpt = frontmatter.excerpt || node.excerpt
    return { ...frontmatter, ...node.fields, excerpt }
  })
  return (
    <LearningPage>
      {posts.map((post, i) => (
        <Card
          key={i}
          width={[1, 1 / 2, 1 / 3, 1 / 4]}
          onClick={() => navigateTo(post.slug)}>
          <PostEntry {...post} />
        </Card>
      ))}
    </LearningPage>
  )
}

export const query = graphql`
  query LearningQuery {
    allMarkdownRemark(filter: { fields: { slug: { regex: "/post/" } } }) {
      edges {
        node {
          excerpt
          fields {
            slug
          }
          frontmatter {
            title
            date(formatString: "MMMM DD, YYYY")
          }
        }
      }
    }
  }
`
<commit_msg>+post: Sort by date<commit_after>import React from 'react'
import styled from 'styled-components'
import { Grid } from 'grid-styled'
import { navigateTo } from 'gatsby-link'

import PostEntry from '@/components/postEntry'

const LearningPage = styled.div`
  min-height: 100%;
  padding: 0.5em;
  background: ${props => props.theme.color.bg};
`

const Card = styled(Grid)`
  padding: 0.5em;
  height: 16em;
  cursor: pointer;

  a {
    color: ${props => props.theme.color.base};
    text-decoration: none;
  }
`

export default function Learning({ data }) {
  const posts = data.allMarkdownRemark.edges.map(({ node }) => {
    const { frontmatter } = node
    const excerpt = frontmatter.excerpt || node.excerpt
    return { ...frontmatter, ...node.fields, excerpt }
  })
  return (
    <LearningPage>
      {posts.map((post, i) => (
        <Card
          key={i}
          width={[1, 1 / 2, 1 / 3, 1 / 4]}
          onClick={() => navigateTo(post.slug)}>
          <PostEntry {...post} />
        </Card>
      ))}
    </LearningPage>
  )
}

export const query = graphql`
  query LearningQuery {
    allMarkdownRemark(
      sort: { order: DESC, fields: [frontmatter___date] }
      filter: {
        fields: { slug: { regex: "/post/" } }
        frontmatter: { draft: { ne: true } }
      }
    ) {
      edges {
        node {
          excerpt
          fields {
            slug
          }
          frontmatter {
            title
            date(formatString: "MMMM DD, YYYY")
          }
        }
      }
    }
  }
`

{'fraction_non_alphanumeric': 0.14461538461538462, 'fraction_numerical': 0.01094017094017094, 'mean_word_length': 2.0133882595262618, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6579312', 'n_tokens_mistral': 1004, 'n_tokens_neox': 945, 'n_words': 225}