Skip to content
Snippets Groups Projects
Commit 5e9d599c authored by alexisben's avatar alexisben
Browse files

handle both data format for persons image

parent fc64491b
No related branches found
No related tags found
No related merge requests found
{{- $title := or .Params.header_text .Title -}}
{{/* LEGACY : à retirer une fois que le format de donnée des images des personnes sera homogène aux autres images */}}
{{- $image := "" -}}
{{ if .Params.image }}
{{ $image = (dict "id" .Params.image) }}
{{ with .Params.image }}
{{ if eq (printf "%T" .) "string" }}
{{ $image = dict "id" . }}
{{ else }}
{{ $image = . }}
{{ end }}
{{ end }}
{{- partial "header/hero.html"
......
......@@ -28,12 +28,18 @@
<div itemscope itemtype="https://schema.org/Person" class="container">
<meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}">
<meta itemprop="url" content="{{ .Permalink }}">
{{- if .Params.image -}}
{{- $image := partial "GetMedia" .Params.image -}}
{{- if $image -}}
<meta itemprop="image" content="{{ $image.url }}">
{{ with .Params.image }}
{{ $image_id := "" }}
{{/* LEGACY : à retirer une fois que le format de donnée des images des personnes sera homogène aux autres images */}}
{{ if eq (printf "%T" .) "string" }}
{{ $image_id = . }}
{{ else }}
{{ $image_id = index . "id" }}
{{ end }}
{{- with partial "GetMedia" $image_id -}}
<meta itemprop="image" content="{{ .url }}">
{{- end -}}
{{- end -}}
{{ end }}
<div class="informations">
<div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment