From f49de02a0ff33d0b6d11a84e5a7a376c2aca62c1 Mon Sep 17 00:00:00 2001 From: Olivia Simonet <91660674+Olivia206@users.noreply.github.com> Date: Wed, 21 Aug 2024 10:47:00 +0200 Subject: [PATCH] [A11Y] Retrait des balises vides dans les blocs (#560) --- layouts/partials/blocks/templates/links.html | 4 +++- layouts/partials/persons/person.html | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/blocks/templates/links.html b/layouts/partials/blocks/templates/links.html index 0da7b2f3..b3a97c49 100644 --- a/layouts/partials/blocks/templates/links.html +++ b/layouts/partials/blocks/templates/links.html @@ -22,7 +22,9 @@ <link itemprop="url" href="{{ .url }}"> <a itemprop="relatedLink" href="{{ .url }}" title="{{ $link_title }}" {{ if $isExternal -}} target="_blank" rel="noopener" {{- end }}><span itemprop="name">{{- $title -}}</span></a> - <p>{{ .description | safeHTML }}</p> + {{ with .description }} + <p>{{ . | safeHTML }}</p> + {{ end }} </div> {{- if .image -}} <div class="media"> diff --git a/layouts/partials/persons/person.html b/layouts/partials/persons/person.html index 5bf5348d..7ccb4a42 100644 --- a/layouts/partials/persons/person.html +++ b/layouts/partials/persons/person.html @@ -17,14 +17,12 @@ </a> {{ end }} {{ $heading_tag.close }} - {{ if $options.summary }} + {{ if and $options.summary (or $person.Params.summary $person.Params.summary) }} <p itemprop="jobTitle"> {{ if (partial "GetTextFromHTML" .role) }} {{ partial "PrepareHTML" .role }} {{ else if partial "GetTextFromHTML" $person.Params.summary }} {{ partial "PrepareHTML" $person.Params.summary }} - {{ else if partial "GetTextFromHTML" $person.Content }} - {{ partial "GetTruncateContent" ( dict "text" $person.Content ) }} {{ end }} </p> {{ end }} -- GitLab