1

Gestion du JSON-LD

This commit is contained in:
2026-03-16 21:21:27 +01:00
parent 7676fe3e22
commit b518d573bc
14 changed files with 275 additions and 8 deletions

View File

@@ -10,16 +10,13 @@
{{- $socialImage := partial "head/social-image.html" . -}}
{{- $openGraphImage := $socialImage.openGraph -}}
{{- $twitterImage := $socialImage.twitter -}}
{{- $searchPath := site.Params.search.action | relURL -}}
{{- $isSearchPage := eq .RelPermalink $searchPath -}}
{{- $noindex := partial "seo/noindex.html" . -}}
{{- $pageClassification := partial "seo/page-classification.html" . -}}
{{- $robots := "max-image-preview:large" -}}
{{- if $isSearchPage -}}
{{- if $noindex -}}
{{- $robots = "noindex, follow" -}}
{{- end -}}
{{- $ogType := "website" -}}
{{- if and .IsPage (not $isSearchPage) -}}
{{- $ogType = "article" -}}
{{- end -}}
{{- $ogType := index $pageClassification "openGraphType" -}}
{{- $localeCode := site.LanguageCode | default site.Language.LanguageCode | default "fr-FR" -}}
{{- $locale := replace $localeCode "-" "_" -}}
<title>{{ $title }}</title>
@@ -60,7 +57,7 @@
{{- with $twitterImage.alt }}
<meta name="twitter:image:alt" content="{{ . }}">
{{- end }}
{{- if eq $ogType "article" -}}
{{- if and (eq $ogType "article") (index $pageClassification "isArticleLike") -}}
{{- with .Date }}
<meta property="article:published_time" content="{{ .Format "2006-01-02T15:04:05Z07:00" }}">
{{- end }}