{"size": 1612, "ext": "js", "max_stars_repo_path": "pages/_document.js", "max_stars_repo_name": "randymorales/randymorales.dev", "max_stars_repo_stars_event_min_datetime": "2021-01-06T16:38:36.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-29T09:28:40.000Z", "max_issues_repo_path": "pages/_document.js", "max_issues_repo_name": "randymorales/randymorales.dev", "max_issues_repo_issues_event_min_datetime": "2021-08-21T04:30:04.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-30T02:00:59.000Z", "max_forks_repo_path": "pages/_document.js", "max_forks_repo_name": "randymorales/randymorales.dev", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 28.7857142857, "max_line_length": 85, "alphanum_fraction": 0.4801488834}
import Document, { Html, Main, NextScript, Head } from 'next/document'

import { GA_TRACKING_ID } from '@/lib/gtag'

export default class MyDocument extends Document {
  static async getInitialProps(ctx) {
    const initialProps = await Document.getInitialProps(ctx)
    return { ...initialProps }
  }

  render() {
    return (
      <Html>
        <Head>
          <link
            rel='alternate'
            type='application/rss+xml'
            title='RSS feed for blog posts'
            href='https://randymorales.dev/rss-en.xml'
          />
          <link rel='preconnect' href='https://fonts.googleapis.com' />
          <link rel='preconnect' href='https://fonts.gstatic.com' />
          <script
            src='https://kit.fontawesome.com/2c36e9b7b1.js'
            crossOrigin='anonymous'
            async
          ></script>
          {/* Global Site Tag (gtag.js) - Google Analytics */}
          {GA_TRACKING_ID ? (
            <>
              <script
                async
                src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
              />
              <script
                dangerouslySetInnerHTML={{
                  __html: `
                window.dataLayer = window.dataLayer || [];
                function gtag(){dataLayer.push(arguments);}
                gtag('js', new Date());
                gtag('config', '${GA_TRACKING_ID}');
              `,
                }}
              />
            </>
          ) : null}
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </Html>
    )
  }
}
