1
Files
2025/layouts/partials/head/data.html

37 lines
1.2 KiB
HTML

{{- $page := . -}}
{{- $title := $page.Site.Title -}}
{{- if not $page.IsHome -}}
{{- $title = printf "%s | %s" $page.Title $page.Site.Title -}}
{{- end -}}
{{- $socialTitle := $page.Site.Title -}}
{{- if not $page.IsHome -}}
{{- $socialTitle = $page.Title -}}
{{- end -}}
{{- $description := partial "head/description.html" $page -}}
{{- $socialImage := partial "head/social-image.html" $page -}}
{{- $noindex := partial "seo/noindex.html" $page -}}
{{- $pageClassification := partial "seo/page-classification.html" $page -}}
{{- $robots := "max-image-preview:large" -}}
{{- if $noindex -}}
{{- $robots = "noindex, follow" -}}
{{- end -}}
{{- $localeCode := $page.Site.LanguageCode | default $page.Site.Language.LanguageCode | default "fr-FR" -}}
{{- return dict
"title" $title
"socialTitle" $socialTitle
"description" $description
"socialImage" $socialImage
"openGraphImage" ($socialImage.openGraph | default dict)
"twitterImage" ($socialImage.twitter | default dict)
"noindex" $noindex
"pageClassification" $pageClassification
"robots" $robots
"ogType" (index $pageClassification "openGraphType")
"localeCode" $localeCode
"locale" (replace $localeCode "-" "_")
-}}