<head>
  <!-- <link rel="preload" href="{{ "lib/font-awesome/webfonts/fa-brands-400.woff2" | relURL }}" as="font" type="font/woff2" crossorigin="anonymous">
  <link rel="preload" href="{{ "lib/font-awesome/webfonts/fa-regular-400.woff2" | relURL }}" as="font" type="font/woff2" crossorigin="anonymous">
  <link rel="preload" href="{{ "lib/font-awesome/webfonts/fa-solid-900.woff2" | relURL }}" as="font" type="font/woff2" crossorigin="anonymous"> -->
  <link rel="preload" href="{{ "lib/JetBrainsMono/web/woff2/JetBrainsMono-Regular.woff2" | relURL }}" as="font" type="font/woff2" crossorigin="anonymous">
  
  {{ if eq .Site.Params.Comments.enabled true }}
  <!-- <script type="text/javascript" src="https://latest.cactus.chat/cactus.js"></script>
  <link rel="stylesheet" href="https://latest.cactus.chat/style.css" type="text/css"> -->
  <link rel="stylesheet" href="{{ "lib/fontawesome6/css/all.min.css" | relURL }}">
  {{ end }}
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>{{ if .IsPage }} {{ .Title }} | {{ end }}{{ .Site.Title }}</title>
  <link rel = 'canonical' href = '{{ .Permalink }}'>
  {{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="robots" content="all,follow">
  <meta name="googlebot" content="index,follow,snippet,archive">
  
  {{ template "_internal/opengraph.html" . }}
  {{ template "_internal/twitter_cards.html" . }}
  <!-- {{ .Scratch.Set "colortheme" "white"}}
  {{ if .Site.Params.Colortheme }}
    {{ .Scratch.Set "colortheme" .Site.Params.Colortheme }}
  {{ end }}
  {{ $colortheme := .Scratch.Get "colortheme" }} -->
  {{ $colortheme := "dynamic" }}

  {{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}}
  {{- $styles := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "scss/style.scss" . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
  <link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}"> 
  <link
    rel="stylesheet"
    href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"
    integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA=="
    crossorigin="anonymous"
    referrerpolicy="no-referrer"
  />
  <!-- Custom CSS -->
  {{ range .Site.Params.css }} <link rel="stylesheet" href="{{ . | absURL }}"> {{ end }}
  {{ `
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  ` | safeHTML }}

  {{ partial "favicon.html" . }}
  {{ if .Site.Params.rss }}
  {{ with .OutputFormats.Get "RSS" }}
    {{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }}
  {{ end }}
  {{ end }}

  {{ if .Site.GoogleAnalytics }}
  {{ if .Site.Params.googleAnalyticsAsync }}
    {{ template "_internal/google_analytics_async.html" . }}
  {{ else }}
    {{ template "_internal/google_analytics.html" . }}
  {{ end }}
  {{ end }}
</head>

<script>
  const t = localStorage.getItem("theme");
  if (t) document.documentElement.classList.add(t);
</script>
