trwnh.com/unified.test.hugo/layouts/partials/seo.html

32 lines
1,005 B
HTML
Raw Normal View History

2024-10-18 07:33:33 +00:00
{{- $fallbackTitle := "" }}
{{- if eq .Section "responses" }}
{{ range .Params.inReplyTo }}
{{- if . }}
{{- $fallbackTitle = printf "in response to %s" (or .name .url) }}
{{- end }}
{{- end }}
{{- else if eq .Section "kb" }}
2024-10-05 06:27:07 +00:00
{{- $firstH1 := partial "firstH1.html" . }}
2024-10-18 07:33:33 +00:00
{{- $fallbackTitle = or $firstH1 $.File.ContentBaseName }}
{{- end }}
2024-11-13 17:24:48 +00:00
2024-10-18 07:33:33 +00:00
{{- $title := or .Title $fallbackTitle }}
{{- $fullTitle := print .Site.Title " | " $title}}
2024-10-05 06:27:07 +00:00
{{- $cover := ($.Resources.ByType "image").GetMatch "{*opengraph*}" -}}
2024-11-13 17:24:48 +00:00
{{ $icon := resources.GetMatch (or .Site.Params.icon ("icon.png" | absURL)) -}}
2024-10-05 06:27:07 +00:00
2024-11-13 17:24:48 +00:00
{{- $author := or .Params.author .Site.Params.author }}
{{- $author_string := "" }}
2024-10-05 06:27:07 +00:00
2024-11-13 17:24:48 +00:00
{{/* TODO: clean up this mess */}}
2024-10-05 06:27:07 +00:00
2024-11-13 17:24:48 +00:00
{{ partial "head/title.html" (dict "title" $title "fullTitle" $fullTitle) }}
{{ partial "head/description.html" . }}
{{ partial "head/url.html" . }}
{{ partial "head/icon.html" $icon }}
{{ partial "head/theme-color.html" . }}
{{ partial "head/site.html" . }}
{{ partial "head/robots.html" . }}