<commit_before>import React from 'react';
import Helmet from 'react-helmet'
import Header from '../components/Header';
import styles from './blog-post.module.css';

export default function BlogTemplate({ data }) {
  const { markdownRemark: post } = data;
  return (
    <div className={styles.post}>
      <Helmet
        title={`${post.frontmatter.title} | <NAME>`}
        meta={[
          { name: 'description', content: post.excerpt },
        ]}
      >
      </Helmet>
      <Header/>
      <h1 className={styles.title}>{post.frontmatter.title}</h1>
      <h5>by <NAME> | {post.frontmatter.date}</h5>
      <div
        dangerouslySetInnerHTML={{ __html: post.html }}
      />
    </div>
  )
}

export const pageQuery = graphql`
  query BlogPostByPath($slug: String!) {
    markdownRemark(fields: { slug: { eq: $slug } } ) {
      html
      frontmatter {
        date(formatString: "MMMM DD, YYYY")
        path
        title
      }
      excerpt
    }
  }
`;
<commit_msg>add canonical link to blog posts<commit_after>import React from 'react';
import Helmet from 'react-helmet'
import Header from '../components/Header';
import styles from './blog-post.module.css';

export default function BlogTemplate({ data }) {
  const { markdownRemark: post } = data;
  const rootUrl = 'https://jgaehring.com/'
  return (
    <div className={styles.post}>
      <Helmet
        title={`${post.frontmatter.title} | <NAME>`}
        meta={[
          { name: 'description', content: post.excerpt },
        ]}
        link={[
          { rel: 'canonical', href: rootUrl + data.markdownRemark.fields.slug }
        ]}
      >
      </Helmet>
      <Header/>
      <h1 className={styles.title}>{post.frontmatter.title}</h1>
      <h5>by <NAME> | {post.frontmatter.date}</h5>
      <div
        dangerouslySetInnerHTML={{ __html: post.html }}
      />
    </div>
  )
}

export const pageQuery = graphql`
  query BlogPostByPath($slug: String!) {
    markdownRemark(fields: { slug: { eq: $slug } } ) {
      html
      frontmatter {
        date(formatString: "MMMM DD, YYYY")
        path
        title
      }
      fields {
        slug
      }
      excerpt
    }
  }
`;

{'fraction_non_alphanumeric': 0.14766958929395477, 'fraction_numerical': 0.0036917397323488694, 'mean_word_length': 2.2998477929984777, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 1, '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': '4908468', 'n_tokens_mistral': 711, 'n_tokens_neox': 694, 'n_words': 152}