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
No related tags found
No related merge requests found
{{- $title := or .Params.header_text .Title -}} {{- $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 := "" -}} {{- $image := "" -}}
{{ if .Params.image }} {{ with .Params.image }}
{{ $image = (dict "id" .Params.image) }} {{ if eq (printf "%T" .) "string" }}
{{ $image = dict "id" . }}
{{ else }}
{{ $image = . }}
{{ end }}
{{ end }} {{ end }}
{{- partial "header/hero.html" {{- partial "header/hero.html"
......
...@@ -28,12 +28,18 @@ ...@@ -28,12 +28,18 @@
<div itemscope itemtype="https://schema.org/Person" class="container"> <div itemscope itemtype="https://schema.org/Person" class="container">
<meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}"> <meta itemprop="name" content="{{ partial "PrepareHTML" .Title }}">
<meta itemprop="url" content="{{ .Permalink }}"> <meta itemprop="url" content="{{ .Permalink }}">
{{- if .Params.image -}} {{ with .Params.image }}
{{- $image := partial "GetMedia" .Params.image -}} {{ $image_id := "" }}
{{- if $image -}} {{/* LEGACY : à retirer une fois que le format de donnée des images des personnes sera homogène aux autres images */}}
<meta itemprop="image" content="{{ $image.url }}"> {{ 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 -}} {{ end }}
<div class="informations"> <div class="informations">
<div> <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