<!DOCTYPE html>
<html lang="{{ or site.Language.LanguageCode site.Language.Lang }}"
  dir="{{ or site.Language.LanguageDirection `ltr` }}">

<head>
  {{ partial "head.html" . }}
</head>

{{ $theme := "auto"}}

{{ with .Param "theme" }}
{{ $theme = .}}
{{ end }}

<body class="{{ $theme }}">

  <div class="content">
    <header>
      {{ partial "header.html" . }}
    </header>

    <main class="main">
      {{ block "main" . }}{{ end }}
    </main>
  </div>

  <footer>
    {{ partial "footer.html" . }}
  </footer>

  {{ if .Param "math" }}
  {{ partialCached "math.html" . }}
  {{ end }}

</body>

<script src="{{ "js/theme-switch.js" | relURL }}"></script>
<script defer src="{{ "js/copy-code.js" | relURL }}"></script>
</html>
