<!doctype html>
<html
  class="h-full antialiased scheme-light dark:scheme-dark"
  lang="{{ or site.Language.LanguageCode `en-US` }}">
  <head>
    <meta charset="utf-8">
    <title>
      {{ .Title }}
    </title>
    <style>
      [x-cloak] {
        display: none !important;
      }
    </style>

    {{ partial "layouts/head/head-js.html" . }}
    {{ with (templates.Defer (dict "key" "global")) }}
      {{ $t := debug.Timer "tailwindcss" }}
      {{ with resources.Get "css/styles.css" }}
        {{ $opts := dict "minify" (not hugo.IsDevelopment) }}
        {{ with . | css.TailwindCSS $opts }}
          {{ partial "helpers/linkcss.html" (dict "r" .) }}
        {{ end }}
      {{ end }}
      {{ $t.Stop }}
    {{ end }}
    {{ $noop := .WordCount }}
    {{ if .Page.Store.Get "hasMath" }}
      <link
        rel="stylesheet"
        href="https://cdn.jsdelivr.net/npm/katex@0.16.25/dist/katex.min.css"
        integrity="sha384-WcoG4HRXMzYzfCgiyfrySxx90XSl2rxY5mnVY5TwtWE6KLrArNKn0T/mOgNL0Mmi"
        crossorigin="anonymous"
      >
    {{ end }}
    {{ partial "layouts/head/head.html" . }}
  </head>

  {{ $bodyClass := printf "flex flex-col min-h-full bg-white dark:bg-blue-950 kind-%s" .Kind }}
  {{ if .Params.searchable }}
    {{ $bodyClass = printf "%s searchable" $bodyClass }}
  {{ end }}

  <body class="{{ $bodyClass }}">
    {{ partial "layouts/hooks/body-start.html" . }}
    {{/* Layout. */}}
    {{ block "header" . }}
      {{ partial "layouts/header/header.html" . }}
    {{ end }}
    {{ block "subheader" . }}
    {{ end }}
    {{ block "hero" . }}
    {{ end }}
    <div class="flex w-full xl:w-6xl h-full flex-auto mx-auto">
      <main
        class="flex-1 mx-auto lg:mx-0 w-full max-w-3x lg:max-w-3x pt-8 lg:pt-14 pb-20 px-main print:pt-0">
        {{ partial "layouts/hooks/body-main-start.html" . }}
        {{ block "main" . }}{{ end }}
      </main>
      {{ block "rightsidebar" . }}
        <aside
          class="py-15 ml-4 xl:ml-12 w-60 hidden lg:relative lg:block lg:flex-none">
          {{ block "rightsidebar_content" . }}{{ end }}
        </aside>
      {{ end }}
    </div>
    {{/* Common icons. */}}
    {{ partial "layouts/icons.html" . }}
    {{/* Common templates. */}}
    {{ partial "layouts/templates.html" . }}
    {{/* Footer. */}}
    {{ block "footer" . }}
      {{ partial "layouts/footer.html" . }}
    {{ end }}
    {{ partial "layouts/hooks/body-end.html" . }}
  </body>
</html>
