---
import 'hint.css'
import '~/sass/full.scss'
import '~/sass/2017/base/prism_line_highlight.scss'

import '@fontsource/cousine/400.css'
import '@fontsource/cousine/700.css'
import '@fontsource/manrope/800.css'
import GoogleAnalytics from '~/analytics/GoogleAnalytics.astro'
import { googleAnalytics } from '~/config'

export type Props = {
  title?: string
  bodyClass?: string
}

const props = Astro.props as Props
const analyticsEnabled = googleAnalytics.enabled
---

<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <meta name="generator" content={Astro.generator} />
    <link rel="shortcut icon" type="image/png" href="/assets/favicon.png" />
    {/* Title */}
    {props.title ? <title>{props.title}</title> : null}
    {/* Google tag */}
    {
      analyticsEnabled && googleAnalytics.measurementId ? (
        <GoogleAnalytics measurementId={googleAnalytics.measurementId} />
      ) : null
    }
    <slot name="head" />
  </head>
  <body class={props.bodyClass ?? ''}>
    <slot />
  </body>
</html>
