{"size": 1911, "ext": "js", "max_stars_repo_path": "src/components/Seo/Seo.js", "max_stars_repo_name": "bhavabhuthi/civicdatalab.github.io", "max_stars_repo_stars_event_min_datetime": "2018-11-05T10:10:44.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-26T07:29:33.000Z", "max_issues_repo_path": "src/components/Seo/Seo.js", "max_issues_repo_name": "bhavabhuthi/civicdatalab.github.io", "max_issues_repo_issues_event_min_datetime": "2021-01-13T03:14:05.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-10T05:13:30.000Z", "max_forks_repo_path": "src/components/Seo/Seo.js", "max_forks_repo_name": "CivicDataLab/website-new", "max_forks_repo_forks_event_min_datetime": "2018-05-20T18:44:09.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-24T11:46:14.000Z"}
{"max_stars_count": 3, "max_issues_count": 44, "max_forks_count": 8, "avg_line_length": 32.3898305085, "max_line_length": 115, "alphanum_fraction": 0.5536368394}
import React from 'react';
import { Helmet } from 'react-helmet';
import { useStaticQuery, graphql } from 'gatsby';

const Seo = ({ description, meta, title, lang = 'en' }) => {
  const { site } = useStaticQuery(
    graphql`
      query {
        site {
          siteMetadata {
            title
            description
            siteUrl
            image
          }
        }
      }
    `
  );

  const metaDescription = description || site.siteMetadata?.description;
  const defaultTitle = site.siteMetadata?.title;

  return (
    <Helmet
      htmlAttributes={{ lang }}
      title={title}
      titleTemplate={title === 'CivicDataLab' ? `%s | Data, Tech, Design, Social Science` : `%s | ${defaultTitle}`}
      meta={[
        { name: 'description', content: metaDescription },
        {
          property: 'og:title',
          content:
            title === 'CivicDataLab'
              ? 'CivicDataLab | Data, Tech, Design, Social Science'
              : `${title} | ${defaultTitle}`
        },
        { property: 'og:description', content: metaDescription },
        { property: 'og:type', content: 'website' },
        { property: 'og:url', content: site.siteMetadata.siteUrl },
        { property: 'og:image', content: `${site.siteMetadata.siteUrl}${site.siteMetadata.image}` },
        { property: 'twitter:card', content: 'summary_large_image' },
        { property: 'twitter:url', content: site.siteMetadata.siteUrl },
        { name: 'twitter:description', content: metaDescription },
        {
          property: 'twitter:title',
          content:
            title === 'CivicDataLab'
              ? 'CivicDataLab | Data, Tech, Design, Social Science'
              : `${title} | ${defaultTitle}`
        },
        { property: 'twitter:image', content: `${site.siteMetadata.siteUrl}${site.siteMetadata.image}` }
      ].concat(meta ? meta : {})}
    />
  );
};

export default Seo;
