head.html 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {{- if eq .Kind "taxonomyTerm" }}
  2. {{- range $key, $value := .Data.Terms.ByCount }}
  3. {{- $.Scratch.Add "most_used" (slice $value.Name) }}
  4. {{- end }}
  5. {{- if not ($.Scratch.Get "most_used") }}
  6. {{- $description := printf "A full overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular | truncate 180 }}
  7. {{- $.Scratch.Set "Description" $description }}
  8. {{- else }}
  9. {{- $description := printf "A full overview of all pages with %s, ordered by %s, such as: %s" .Data.Plural .Data.Singular ( delimit ( $.Scratch.Get "most_used" ) ", " ", and " ) | truncate 180 }}
  10. {{- $.Scratch.Set "Description" $description }}
  11. {{- end }}
  12. {{- $title := printf "Overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular }}
  13. {{- $.Scratch.Set "Title" $title }}
  14. {{- else if eq .Kind "taxonomy" }}
  15. {{- $description := printf "Overview of all pages with the %s #%s, such as: %s" .Data.Singular $.Title ( index .Pages 0).Title | truncate 160 }}
  16. {{- $.Scratch.Set "Description" $description }}
  17. {{- $title := printf "Overview of all pages with the %s #%s" .Data.Singular $.Title }}
  18. {{- $.Scratch.Set "Title" $title }}
  19. {{- else }}
  20. {{- $.Scratch.Set "Description" ( .Description | default .Params.subtitle | default .Summary ) }}
  21. {{- $.Scratch.Set "Title" ( .Title | default .Site.Title ) }}
  22. {{- end }}
  23. <meta charset="utf-8" />
  24. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  25. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  26. <!-- Site Title, Description, Author, and Favicon -->
  27. {{ if .IsHome }}
  28. {{- with .Site.Params.homeTitle }}
  29. <title>{{ . }}</title>
  30. {{- end }}
  31. {{ else }}
  32. {{- with ($.Scratch.Get "Title") }}
  33. <title>{{ . }} - {{ $.Site.Params.homeTitle }}</title>
  34. {{- end }}
  35. {{ end }}
  36. {{- with ($.Scratch.Get "Description") }}
  37. <meta name="description" content="{{ . }}">
  38. {{- end }}
  39. {{- with .Site.Params.author.name }}
  40. <meta name="author" content="{{ . }}"/>
  41. {{- end }}
  42. {{- partial "seo/main.html" . }}
  43. {{- with .Site.Params.favicon }}
  44. <link href='{{ . | absURL }}' rel='icon' type='image/x-icon'/>
  45. {{- end -}}
  46. <!-- Hugo Version number -->
  47. {{ hugo.Generator -}}
  48. <!-- Links and stylesheets -->
  49. <link rel="alternate" href="{{ "index.xml" | absLangURL }}" type="application/rss+xml" title="{{ .Site.Title }}">
  50. {{- if .Site.Params.selfHosted -}}
  51. <link rel="stylesheet" href="{{ "css/katex.min.css" | absURL }}" />
  52. <link rel="stylesheet" href="{{ "fontawesome/css/all.css" | absURL }}" />
  53. <link rel="stylesheet" href="{{ "css/bootstrap.min.css" | absURL }}" />
  54. {{- else -}}
  55. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.7/dist/katex.min.css" integrity="sha384-3UiQGuEI4TTMaFmGIZumfRPtfKQ3trwQE2JgosJxCnGmQpL/lJdjpcHkaaFwHlcI" crossorigin="anonymous">
  56. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v6.6.0/css/all.css" integrity="sha384-h/hnnw1Bi4nbpD6kE7nYfCXzovi622sY5WBxww8ARKwpdLj5kUWjRuyiXaD1U2JT" crossorigin="anonymous">
  57. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
  58. {{- end -}}
  59. <link rel="stylesheet" href="{{ "css/main.css" | absURL }}" />
  60. {{- if .Site.Params.staticman -}}
  61. <link rel="stylesheet" href="{{ "css/staticman.css" | absURL }}" />
  62. {{- end -}}
  63. {{- if .Site.Params.selfHosted -}}
  64. <link rel="stylesheet" href="{{ "css/fonts.css" | absURL }}" />
  65. {{- else -}}
  66. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
  67. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
  68. {{- end -}}
  69. {{- if .Site.Params.useHLJS }}
  70. <link rel="stylesheet" href="{{ "css/highlight.min.css" | absURL }}" />
  71. {{- else -}}
  72. <link rel="stylesheet" href="{{ "css/syntax.css" | absURL }}" />
  73. {{- end -}}
  74. <link rel="stylesheet" href="{{ "css/codeblock.css" | absURL }}" />
  75. {{- if .Site.Params.staticman.recaptcha -}}
  76. <script src='https://www.google.com/recaptcha/api.js'></script>
  77. {{- end -}}
  78. {{- if .Site.Params.selfHosted -}}
  79. <link rel="stylesheet" href="{{ "css/photoswipe.min.css" | absURL }}" />
  80. <link rel="stylesheet" href="{{ "css/photoswipe.default-skin.min.css" | absURL }}" />
  81. {{- else -}}
  82. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
  83. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">
  84. {{- end -}}
  85. {{- partial "head_custom.html" . }}
  86. {{- if not hugo.IsServer -}}
  87. {{ template "_internal/google_analytics.html" . }}
  88. {{- end -}}