text: import Document, { Html, Head, Main, NextScript } from 'next/document'
  import React from 'react'
  import SiteConfig from '../site.config'
  
  class MyDocument extends Document {
    static async getInitialProps(ctx) {
      const initialProps = await Document.getInitialProps(ctx)
      return { ...initialProps }
    }
  
    render() {
      return (
        <Html lang={SiteConfig.lang}>
          <Head>
            {/* base */}
            <meta charSet="utf-8" />
            <meta httpEquiv="x-ua-compatible" content="ie=edge" />
            <meta name="description" content={SiteConfig.description} />
  
            {/* facebook */}
            <meta property="og:url" content={SiteConfig.siteUrl} />
            <meta property="og:type" content="website" />
            <meta property="og:title" content={SiteConfig.title} />
            <meta property="og:description" content={SiteConfig.description} />
  
            {/* twitter */}
            <meta name="twitter:card" content="summary" />
            <meta name="twitter:url" content={SiteConfig.siteUrl} />
            <meta name="twitter:title" content={SiteConfig.title} />
            <meta name="twitter:description" content={SiteConfig.description} />
  
            {/* analytic */}
            {SiteConfig.googleAnalytic && (
              <>
                <script
                  async
                  src={`https://www.googletagmanager.com/gtag/js?id=${SiteConfig.googleAnalytic}`}
                />
                <script
                  type="text/javascript"
                  dangerouslySetInnerHTML={{
                    __html: `window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '${SiteConfig.googleAnalytic}');`
                  }}
                />
              </>
            )}
  
            {/* favicon */}
            <link rel="shortcut icon" href="/images/logo.svg" />
          </Head>
          <body>
            <Main />
            <NextScript />
          </body>
        </Html>
      )
    }
  }
  
  export default MyDocument
  