{{- $title := chomp (htmlUnescape .Title) -}} {{- $seoTitle := htmlUnescape site.Title -}} {{- $seoTitleSeparator := htmlUnescape site.Params.seo.title.separator -}} {{- if .Title -}} {{- $seoTitle = printf "%s %s %s" $title $seoTitleSeparator $seoTitle -}} {{- end -}} {{- $seoTitle = partial "GetPaginateTitle" ( dict "title" $seoTitle "separator" $seoTitleSeparator "context" .) -}} {{- $seoDescription := "" -}} {{- if .Params.meta_description -}} {{- $seoDescription = partial "PrepareHTML" .Params.meta_description -}} {{- else if .Params.summary -}} {{- $seoDescription = .Params.summary | safeHTML -}} {{- else if .Content -}} {{- $seoDescription = partial "GetTruncateContent" ( dict "text" .Content ) -}} {{- else if .Params.legacy_text -}} {{- $seoDescription = partial "GetTruncateContent" ( dict "text" .Params.legacy_text ) -}} {{- else if .Params.contents -}} {{- range first 1 .Params.contents -}} {{- if .title -}} {{- $seoDescription = partial "GetTruncateContent" ( dict "text" .title ) -}} {{- end -}} {{- end -}} {{- end -}} {{- $sharedImage := "" -}} {{- $ogImage := "" -}} {{- $twitterImage := "" -}} {{- $pagefindImage := "" -}} {{- if index site.Data.website.default "shared_image" -}} {{- $sharedImage = partial "GetMedia" (index site.Data.website.default.shared_image "id") -}} {{- end -}} {{ with .Params.image }} {{- $sharedImage = partial "GetMedia" .id -}} {{ end }} {{- with $sharedImage -}} {{- $ogImage = partial "GetImageUrl" (dict "media" . "size" "1200" ) -}} {{- $twitterImage = partial "GetImageUrl" (dict "media" . "size" "1200" ) -}} {{- $pagefindImage = partial "GetImageUrl" (dict "media" . "size" "244" ) -}} {{- end -}} {{- $seoUrl := .Permalink -}} {{ $seoTitle }} {{- with $ogImage }} {{ end -}} {{- with $twitterImage }} {{ end -}} {{- if site.Data.school.twitter }} {{ else if site.Data.journal.twitter }} {{ end -}} {{ if site.Params.search.active }} {{ with $pagefindImage }} {{ end }} {{ end }} {{/* Limiter le tracking par le CDN https://framagit.org/chatons/CHATONS/-/issues/200#note_1987024 */}}