Skip to content
Snippets Groups Projects
Unverified Commit 61099d23 authored by Alexis BENOIT's avatar Alexis BENOIT Committed by GitHub
Browse files

Merge pull request #323 from osunyorg/person-image-data-format

Person image data format
parents fc64491b 5e9d599c
No related branches found
Tags v7.2.6
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