<head>
  {{ $is_blog := and (eq .Type "blog") (eq .Kind "page") }}
  <meta charset="utf-8">
  <meta name="robots" content="all,follow">
  <meta name="googlebot" content="index,follow,snippet,archive">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  {{ $title_plain := .Title | markdownify | plainify }}
  {{ if eq $title_plain "Blog"}}
  <title>{{ .Site.Params.Title }} | Blog</title>
  {{ else if $is_blog}}
  <title>{{ .Site.Params.Title }} | Blog - {{ $title_plain }}</title>
  {{ else }}
  <title>{{ .Site.Params.Title }} | {{ $title_plain }}</title>
  {{ end }}
  
  <meta name="author" content="{{ .Param "author" }}">
  
  {{ $keywords := .Site.Params.defaultMetaKeywords | default (slice "" | first 0) }}
  {{ range .Params.metaKeywords }}{{ $keywords = $keywords | append . }}{{ end }}
   
  {{ if gt (len $keywords) 0 }}
  <meta name="keywords" content="{{ delimit (uniq $keywords) ", " }}">
  {{ end }}
  
  {{ $description_plain := default .Site.Params.defaultMetaDescription .Params.metaDescription | markdownify | plainify }}
  <meta name="description" content="{{ $description_plain }}">

  {{ hugo.Generator }}

  <link href="{{ "css/main.css" | relURL }}" rel="stylesheet">

  <!-- Favicon and Apple touch icons-->
  <link rel="shortcut icon" href="{{ "img/favicon.ico" | relURL }}" type="image/x-icon">
  <link rel="apple-touch-icon" href="{{ "img/apple-touch-icon.png" | relURL }}">

  {{ range .AlternativeOutputFormats -}}
    {{ printf `<link rel="%s" type="%s" href="%s" title="%s">` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
  {{ end -}}

  {{ partial "opengraph.html" . }}

  <script src="/js/htmx/htmx.min.js" defer></script>
  <script src="/js/main.js" defer></script>
</head>
