<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta name="referrer" content="strict-origin" />
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <title>{{ if .IsHome }}{{ .Title }}{{ else }}{{ .Title }} &middot; {{ .Site.Title }}{{ end }}</title>
  {{ if .Site.Params.name }}<meta name="author" content="{{ .Site.Params.name }}" />{{ end }}
  {{ if .Site.Params.description }}<meta name="description" content="{{ .Site.Params.description }}" />{{ end }}
  {{ if .Site.Params.favicon }} <link rel="icon" href="{{ .Site.Params.favicon }}" /> {{ end }}

  <link type="text/css" rel="stylesheet" href="./css/main.css" />
  <link type="text/css" rel="stylesheet" href="./css/search.css" />
  <link type="text/css" rel="stylesheet" href="./css/color.css" />
  
  {{/*  font awesome CDN link  */}}
  {{ if .Site.Params.fontawesomeCDN }}
    <link type="text/css" rel="stylesheet" href="{{ .Site.Params.fontawesomeCDN | safeURL }}"
      integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" 
      crossorigin="anonymous" />
  {{ else }}
    <link type="text/css" rel="stylesheet"
      href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"
      integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" 
      crossorigin="anonymous" />
  {{ end }}
  {{/*  font awesome CDN link ends  */}}

  {{/*  search and init scripts  */}}
  <script src="./js/search.js"></script>
  <script src="./js/init.js"></script>
  <script>
    // window.onload = () => {
    //   init();
    // }

    document.addEventListener('DOMContentLoaded', (event) => {
      init();
    });
  </script>
  {{/*  search and init scripts end  */}}

  {{/*  theme style config */}}
  {{- partial "style.html" . -}}
  {{/*  theme style config ends  */}}

  {{/*  custom CSSes  */}}
  {{ if .Site.Params.customCSS.enabled }}
    {{ range .Site.Params.customCSS.items }}
      {{ if ne .activated false}}
          <link type="text/css" rel="stylesheet" href="{{ .url | safeURL }}" />
      {{ end }}
    {{ end }}
  {{ end }}
  {{/*  custom CSSes end  */}}

</head>
