{{- $fallbackTitle := "" }} {{- if eq .Section "responses" }} {{ range .Params.inReplyTo }} {{- if . }} {{- $fallbackTitle = printf "in response to %s" (or .name .url) }} {{- end }} {{- end }} {{- else if eq .Section "wiki" }} {{- $firstH1 := partial "firstH1.html" . }} {{- $fallbackTitle = or $firstH1 $.File.ContentBaseName }} {{- end }} {{- $title := or .Title $fallbackTitle }} {{- $fullTitle := print .Site.Title " | " $title}} {{- $cover := ($.Resources.ByType "image").GetMatch "{*opengraph*}" -}} {{ $icon := resources.GetMatch (default "" .Site.Params.icon) -}} {{/*=== title ===*/}} {{ "" | safeHTML }} {{- with .Site.Title }} {{- end -}} {{- if .IsHome}} {{- with or .Params.name .Site.Title }} {{ . }} {{- end }} {{- else }} {{ or .Params.name $fullTitle }} {{- end -}} {{/*=== description ===*/}} {{- with or .Description .Params.summary .Site.Params.description (plainify (.Content | safeHTML) | strings.Truncate 140) }} {{- end }} {{ "" | safeHTML }} {{- with .Permalink | absURL}} {{- end -}} {{/*=== image ===*/}} {{- $staticIcon := "icon.png" | absURL -}} {{- with or $cover $icon }} {{ "" | safeHTML }} {{- with .Width }} {{- end }} {{- with .Height }} {{- end }} {{- else }} {{ "" | safeHTML }} {{- end -}} {{/*=== extra params? ===*/}} {{- with .Params.audio }}{{ end }} {{- with .Params.locale }}{{ end }} {{- with .Params.videos }}{{- range . }} {{ end }}{{ end -}} {{/*=== article ===*/}} {{- with or .Params.author .Site.Params.author }} {{ "" | safeHTML }} {{- end }} {{- if or .Date .Lastmod }} {{ "" | safeHTML }} {{- end }} {{ with .Date -}} {{ end -}} {{ with .Lastmod -}} {{ end -}} {{/*=== section and keywords ===*/}} {{- with.Params.category -}} {{- "" | safeHTML -}} {{- end -}} {{- with .Params.tags -}} {{- end -}} {{/* if it has a date, it's probably an article */}} {{- if isset .Params "date" }} {{- "" | safeHTML }} {{- else }} {{- /* otherwise if it doesn't have a date it's probably just a webpage */}} {{- "" | safeHTML }} {{- end -}} {{/* auxiliary info */}} {{ "" | safeHTML }} {{ with $icon }} {{- else -}} {{- end }} {{/* TODO: make this a variable in site config */}} {{/* TODO: make this a variable in site config */}} {{ with .OutputFormats.Get "RSS" -}} {{- end }} {{- with .OutputFormats.Get "Atom" -}} {{- end }} {{- with .OutputFormats.Get "Sitemap" -}} {{- end -}} {{- /* TODO: more output formats? or possibly loop/iterate over all output formats? (probably not, don't want to link to lunr.json do we?) */ -}} {{- /* robots */ -}} {{ "" | safeHTML }}