{{- /* based on Hugo 0.119.0 _internal/opengraph.html but with modified title */}}
{{- $format := partial "get-format.hugo" . }}
{{- $outputFormat := partial "output-format.hugo" (dict "page" . "format" $format) }}
{{- $basename := "index" }}
{{- if eq $outputFormat "searchpage" }}
{{- $basename = partial "BaseName.hugo" $format.RelPermalink }}
{{- end }}
{{- $page := . }}
{{- $title := .Title }}
{{- if eq $outputFormat "searchpage" }}
{{- $title = T "Search" }}
{{- else if eq .Kind "taxonomy" }}
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Title }}
{{- else if eq .Kind "term" }}
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
{{- $title = default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
{{- $title = printf "%s %s %s" (default (humanize .Data.Term | strings.Title) .Title) (default "::" .Site.Params.titleSeparator) $title }}
{{- end }}
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
{{- end }}
{{- with $.Params.images }}
{{- range first 6 . }}
{{- end }}
{{- else }}
{{- $images := $.Resources.ByType "image" }}
{{- $featured := $images.GetMatch "*feature*" }}
{{- if not $featured }}
{{- $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}
{{- end }}
{{- with $featured }}
{{- else }}
{{- with $.Site.Params.images }}
{{- end }}
{{- end }}
{{- end }}
{{- if .IsPage }}
{{- $iso8601 := "2006-01-02T15:04:05-07:00" }}
{{- with .Parent }}
{{- $page := . }}
{{- $link := "" }}
{{- $title := .Title }}
{{- if eq $outputFormat "searchpage" }}
{{- $title = T "Search" }}
{{- else if eq .Kind "taxonomy" }}
{{- $title = default (default .Data.Plural (i18n .Data.Plural)) .Title }}
{{- else if eq .Kind "term" }}
{{- $taxonomy_page := .Site.GetPage .Data.Plural }}
{{- $title = default (default .Data.Singular (i18n .Data.Singular)) $taxonomy_page.Params.SingularTitle }}
{{- $title = printf "%s %s %s" (default (humanize .Data.Term | strings.Title) .Title) (default "::" .Site.Params.titleSeparator) $title }}
{{- end }}
{{- if and $title .Site.Title (not (eq $title .Site.Title)) }}
{{- $title = printf "%s %s %s" $title (default "::" .Site.Params.titleSeparator) .Site.Title }}
{{- end }}
{{- end }}
{{- with .PublishDate }}
{{- end }}
{{- with .Lastmod }}
{{- end }}
{{- end }}
{{- with .Params.audio }}
{{- end }}
{{- with .Params.locale }}
{{- end }}
{{- with .Site.Title }}
{{- end }}
{{- with .Params.videos }}
{{- range . }}
{{- end }}
{{- end }}
{{- /* If it is part of a series, link to related articles */}}
{{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }}
{{- if $siteSeries }}
{{- with .Params.series }}
{{- range $name := . }}
{{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}
{{ end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
{{- $facebookAdmin := "" }}
{{- with site.Params.social.facebook_admin }}
{{- $facebookAdmin = . }}
{{- else }}
{{- with site.Social.facebook_admin }}
{{- $facebookAdmin = . }}
{{- $hugoVersion := "0.120.0" }}
{{- if ge hugo.Version $hugoVersion }}
{{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }}
{{- end }}
{{- end }}
{{- end }}
{{- /* Facebook Page Admin ID for Domain Insights */}}
{{- with $facebookAdmin }}
{{- end }}