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