<commit_before>/**
 * SEO component that queries for data with
 *  Gatsby's useStaticQuery React hook
 *
 * See: https://www.gatsbyjs.org/docs/use-static-query/
 */

import React, { FunctionComponent } from "react"
import { Helmet } from "react-helmet"
import { graphql, useStaticQuery, PageProps } from "gatsby"
import FreestyleFont from "../../fonts/Freestyle-Script.ttf"
import CourgetteFont from "../../fonts/Courgette-Regular.ttf"
import PlayfairFont from "../../fonts/PlayfairDisplay-Italic-VariableFont_wght.ttf"
import { useCustomTranslation } from "../../i18n"
import DefaultImgUrl from "../../images/SocialNetworkDefault.jpg"
import { getHostname, getPathForEnglish, getPathForFrench } from "../../utils"

interface SEOProps {
  description?: string
  googleDescription?: string
  lang?: string
  meta?: any
  title?: string
  image?: string
  location: PageProps["location"]
}
const SEO: FunctionComponent<SEOProps> = ({
  description,
  googleDescription,
  lang,
  meta = [],
  title,
  image,
  location,
}) => {
  const { site } = useStaticQuery(
    graphql`
      query {
        site {
          siteMetadata {
            title
            author
          }
        }
      }
    `
  )
  const { t, i18n } = useCustomTranslation("common")

  const metaDescription = description || t("description")
  const metaGoogleDescription = googleDescription || metaDescription
  const metaTitle = title || site.siteMetadata.title
  const metaImage = `${getHostname(location)}${image || DefaultImgUrl}`
  const metaLang = lang || i18n.languageCode
  return (
    // @ts-ignore hreflang :(
    <Helmet
      htmlAttributes={{
        lang: metaLang,
      }}
      link={[
        {
          rel: "alternate",
          href: `${getHostname(location)}${getPathForFrench(location)}`,
          hreflang: "fr-fr",
        },
        {
          rel: "alternate",
          href: `${getHostname(location)}${getPathForEnglish(location)}`,
          hreflang: "en-us",
        },
        {
          rel: "preload",
          as: "font",
          href: FreestyleFont,
          type: "font/ttf",
          crossOrigin: "anonymous",
        },
        {
          rel: "preload",
          as: "font",
          href: CourgetteFont,
          type: "font/ttf",
          crossOrigin: "anonymous",
        },
        {
          rel: "preload",
          as: "font",
          href: PlayfairFont,
          type: "font/ttf",
          crossOrigin: "anonymous",
        },
      ]}
      title={metaTitle}
      titleTemplate={`${metaTitle} | ${t("head")}`}
      meta={[
        {
          name: `description`,
          content: metaGoogleDescription,
        },
        {
          name: `viewport`,
          content: "width=device-width, initial-scale=1.0",
        },
        {
          property: `og:title`,
          content: metaTitle,
        },
        {
          property: `og:description`,
          content: metaDescription,
        },
        {
          property: `og:type`,
          content: `website`,
        },
        { property: "og:image", content: `${metaImage}` },
        {
          name: `twitter:creator`,
          content: site.siteMetadata.author,
        },
        {
          name: `twitter:title`,
          content: metaTitle,
        },
        {
          name: `twitter:description`,
          content: metaDescription,
        },
        { name: "twitter:image", content: `${metaImage}` },
        { name: "twitter:card", content: "summary_large_image" },
      ].concat(meta)}
    />
  )
}

export default SEO
<commit_msg>chore: add pinterest verification<commit_after>/**
 * SEO component that queries for data with
 *  Gatsby's useStaticQuery React hook
 *
 * See: https://www.gatsbyjs.org/docs/use-static-query/
 */

import React, { FunctionComponent } from "react"
import { Helmet } from "react-helmet"
import { graphql, useStaticQuery, PageProps } from "gatsby"
import FreestyleFont from "../../fonts/Freestyle-Script.ttf"
import CourgetteFont from "../../fonts/Courgette-Regular.ttf"
import PlayfairFont from "../../fonts/PlayfairDisplay-Italic-VariableFont_wght.ttf"
import { useCustomTranslation } from "../../i18n"
import DefaultImgUrl from "../../images/SocialNetworkDefault.jpg"
import { getHostname, getPathForEnglish, getPathForFrench } from "../../utils"

interface SEOProps {
  description?: string
  googleDescription?: string
  lang?: string
  meta?: any
  title?: string
  image?: string
  location: PageProps["location"]
}
const SEO: FunctionComponent<SEOProps> = ({
  description,
  googleDescription,
  lang,
  meta = [],
  title,
  image,
  location,
}) => {
  const { site } = useStaticQuery(
    graphql`
      query {
        site {
          siteMetadata {
            title
            author
          }
        }
      }
    `
  )
  const { t, i18n } = useCustomTranslation("common")

  const metaDescription = description || t("description")
  const metaGoogleDescription = googleDescription || metaDescription
  const metaTitle = title || site.siteMetadata.title
  const metaImage = `${getHostname(location)}${image || DefaultImgUrl}`
  const metaLang = lang || i18n.languageCode
  return (
    // @ts-ignore hreflang :(
    <Helmet
      htmlAttributes={{
        lang: metaLang,
      }}
      link={[
        {
          rel: "alternate",
          href: `${getHostname(location)}${getPathForFrench(location)}`,
          hreflang: "fr-fr",
        },
        {
          rel: "alternate",
          href: `${getHostname(location)}${getPathForEnglish(location)}`,
          hreflang: "en-us",
        },
        {
          rel: "preload",
          as: "font",
          href: FreestyleFont,
          type: "font/ttf",
          crossOrigin: "anonymous",
        },
        {
          rel: "preload",
          as: "font",
          href: CourgetteFont,
          type: "font/ttf",
          crossOrigin: "anonymous",
        },
        {
          rel: "preload",
          as: "font",
          href: PlayfairFont,
          type: "font/ttf",
          crossOrigin: "anonymous",
        },
      ]}
      title={metaTitle}
      titleTemplate={`${metaTitle} | ${t("head")}`}
      meta={[
        {
          name: `description`,
          content: metaGoogleDescription,
        },
        {
          name: `viewport`,
          content: "width=device-width, initial-scale=1.0",
        },
        {
          property: `og:title`,
          content: metaTitle,
        },
        {
          property: `og:description`,
          content: metaDescription,
        },
        {
          property: `og:type`,
          content: `website`,
        },
        { property: "og:image", content: `${metaImage}` },
        {
          name: `twitter:creator`,
          content: site.siteMetadata.author,
        },
        {
          name: `twitter:title`,
          content: metaTitle,
        },
        {
          name: `twitter:description`,
          content: metaDescription,
        },
        { name: "twitter:image", content: `${metaImage}` },
        { name: "twitter:card", content: "summary_large_image" },
        { name: "p:domain_verify", content: "107b7224979c7f379a91649fdca0813b" },
      ].concat(meta)}
    />
  )
}

export default SEO

{'fraction_non_alphanumeric': 0.13891190278928472, 'fraction_numerical': 0.005385252692626346, 'mean_word_length': 2.015403830141549, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '944794', 'n_tokens_mistral': 2130, 'n_tokens_neox': 2111, 'n_words': 441}