deliciousium/themes/lightbi-hugo/layouts/partials/head.html

87 lines
3.9 KiB
HTML

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VRQ9V3YJSJ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-VRQ9V3YJSJ');
</script>
{{- if eq .Kind "taxonomyTerm" }}
{{- range $key, $value := .Data.Terms.ByCount }}
{{- $.Scratch.Add "most_used" (slice $value.Name) }}
{{- end }}
{{- if not ($.Scratch.Get "most_used") }}
{{- $description := printf "A full overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular | truncate 180 }}
{{- $.Scratch.Set "Description" $description }}
{{- else }}
{{- $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 }}
{{- $.Scratch.Set "Description" $description }}
{{- end }}
{{- $title := printf "Overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular }}
{{- $.Scratch.Set "Title" $title }}
{{- else if eq .Kind "taxonomy" }}
{{- $description := printf "Overview of all pages with the %s #%s, such as: %s" .Data.Singular $.Title ( index .Pages 0).Title | truncate 160 }}
{{- $.Scratch.Set "Description" $description }}
{{- $title := printf "Overview of all pages with the %s #%s" .Data.Singular $.Title }}
{{- $.Scratch.Set "Title" $title }}
{{- else }}
{{- $.Scratch.Set "Description" ( .Description | default .Params.subtitle | default .Summary ) }}
{{- $.Scratch.Set "Title" ( .Title | default .Site.Title ) }}
{{- end }}
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Site Title, Description, Author, and Favicon -->
{{ if .IsHome }}
<title>{{ $.Site.Title }}</title>
{{ if (isset $.Site.Params "description") }}
<meta name="description" content="{{ $.Site.Params.description }}">
{{ end }}
{{- else }}
{{- with ($.Scratch.Get "Title") }}
<title>{{ . }} - {{ $.Site.Title }}</title>
{{- end }}
{{- with ($.Scratch.Get "Description") }}
<meta name="description" content="{{ . }}">
{{- end }}
{{ end }}
{{- with .Site.Author.name }}
<meta name="author" content="{{ . }}">
{{- end }}
{{- partial "seo/main.html" . }}
<link rel="apple-touch-icon" sizes="180x180" href=" {{ "favicon/apple-touch-icon.png" | absURL }}">
<link rel="icon" type="image/png" sizes="32x32" href="{{ "favicon/favicon-32x32.png" | absURL }}">
<link rel="icon" type="image/png" sizes="16x16" href="{{ "favicon/favicon-16x16.png" | absURL }}">
<!-- Hugo Version number -->
{{ hugo.Generator -}}
<!-- Links and stylesheets -->
{{- if .Site.Params.selfHosted -}}
<link rel="stylesheet" href="{{ "css/bootstrap.min.css" | absURL }}">
<link rel="stylesheet" href="{{ "css/bootstrap-icons/bootstrap-icons.css" | absURL }}">
{{- else -}}
<link rel="alternate" href="{{ "index.xml" | absLangURL }}" type="application/rss+xml" title="{{ .Site.Title }}">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
{{- end }}
<link rel="stylesheet" href="{{ "css/main.css" | absURL }}">
<link disabled id="dark-mode-theme" rel="stylesheet" href="{{ "css/dark.css" | absURL }}">
{{- if .Site.Params.useHLJS }}
<link rel="stylesheet" href="{{ "css/highlight.min.css" | absURL }}">
{{- else -}}
<link rel="stylesheet" href="{{ "css/syntax.css" | absURL }}">
{{- end -}}
<link rel="stylesheet" href="{{ "css/codeblock.css" | absURL }}">
<link rel="stylesheet" href="{{ "./css/style.css" | absURL }}">
{{- partial "head_custom.html" . }}
{{ template "_default/google_analytics_async.html" . }}