<commit_before>import { graphql, Link, useStaticQuery } from 'gatsby'
import { Column, Menu, Tag } from 'rbx'
import * as React from 'react'

export const SidebarMenu = () => {
  const data = useStaticQuery(sidebarQuery)
  const schemas = data.allFile.edges.map(({node}) => {
    return {
      ...node,
      title: node.name.split('.')[0],
      group: node.relativeDirectory
    }
  })
  return (
    <Column narrow={true} className="has-background-light">
      <Menu>
        <Menu.Label>Schema</Menu.Label>
        <Menu.List>
          {schemas.map(schema => (
            <Menu.List.Item as={Link} to={schema.title} key={schema.id}>
              {schema.title} <Tag color="info">{schema.group}</Tag>
            </Menu.List.Item>
          ))}
        </Menu.List>
      </Menu>
    </Column>
  )
}

const sidebarQuery = graphql`
  query SidebarQuery {
    allFile(
      filter: {
        sourceInstanceName: { eq: "schemas" }
        internal: {mediaType: {eq: "text/yaml"}}
      }
    ) {
      edges {
        node {
          id
          name
          relativePath
          relativeDirectory
        }
      }
    }
  }
`<commit_msg>Alphabetically sort side navigation items<commit_after>import { graphql, Link, useStaticQuery } from 'gatsby'
import { Column, Menu, Tag } from 'rbx'
import * as React from 'react'

export const SidebarMenu = () => {
  const data = useStaticQuery(sidebarQuery)
  const schemas = data.allFile.edges.map(({ node }) => {
    return {
      ...node,
      title: node.name.split('.')[0],
      group: node.relativeDirectory
    }
  })
  return (
    <Column narrow={true} className="has-background-light">
      <Menu>
        <Menu.Label>Schema</Menu.Label>
        <Menu.List>
          {schemas.map(schema => (
            <Menu.List.Item as={Link} to={schema.title} key={schema.id}>
              {schema.title}{' '}
              {schema.group && <Tag color="info">{schema.group}</Tag>}
            </Menu.List.Item>
          ))}
        </Menu.List>
      </Menu>
    </Column>
  )
}

const sidebarQuery = graphql`
  query SidebarQuery {
    allFile(
      filter: {
        sourceInstanceName: { eq: "schemas" }
        internal: { mediaType: { eq: "text/yaml" } }
      }
      sort: { fields: [name] }
    ) {
      edges {
        node {
          id
          name
          relativePath
          relativeDirectory
        }
      }
    }
  }
`
{'fraction_non_alphanumeric': 0.14767054908485858, 'fraction_numerical': 0.0008319467554076539, 'mean_word_length': 1.9257907542579076, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 33, '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': '4644820', 'n_tokens_mistral': 758, 'n_tokens_neox': 751, 'n_words': 151}