Skip to content
Snippets Groups Projects
Unverified Commit 338a4e6b authored by Olivia Simonet's avatar Olivia Simonet Committed by GitHub
Browse files

[A11Y] Ajout d'attributs aria (#592)

parent 47eb76b9
No related branches found
No related tags found
No related merge requests found
......@@ -34,11 +34,11 @@
{{- end -}}
</div>
{{ if .image }}
<figure>
<figure role="figure" {{- with or .alt .credit }} aria-label="{{ . | plainify }}" {{ end }}>
{{ partial "commons/image.html"
(dict
"image" .image.file
"alt" .image.alt
"alt" .alt
"sizes" site.Params.image_sizes.blocks.call_to_action
)}}
{{ if partial "GetTextFromHTML" .credit }}
......
......@@ -30,7 +30,7 @@
{{ end -}}
</div>
{{ if .image }}
<figure class="{{- $image_class -}}">
<figure role="figure" class="{{- $image_class -}}" {{- with or .alt .credit }} aria-label="{{ . | plainify }}" {{ end }}>
{{ if not site.Params.image_sizes.design_system.lightbox.disabled }}
<a class="glightbox"
role="button"
......@@ -44,6 +44,7 @@
{{ partial "commons/image.html"
(dict
"image" .image
"alt" .alt
"sizes" site.Params.image_sizes.blocks.chapter
)}}
{{ if not site.Params.image_sizes.design_system.lightbox.disabled }}
......
......@@ -27,7 +27,7 @@
<p>{{ .description | safeHTML }}</p>
</div>
{{- if .image -}}
<figure>
<figure role="figure" {{- with or .alt .credit }} aria-label="{{ . | plainify }}" {{ end }}>
{{- partial "commons/image.html"
(dict
"image" .image
......
......@@ -5,7 +5,7 @@
{{ if .file }}
{{- $image := partial "GetMedia" .file -}}
{{- if $image -}}
<figure {{ if $is_carousel }} id="carousel-item-{{$index}}" role="{{$role}}" aria-roledescription="slide" class="carousel__slide" aria-label="item-{{$index}}" {{ end }}>
<figure role="figure" {{ if $is_carousel }} id="carousel-item-{{$index}}" role="{{$role}}" aria-roledescription="slide" class="carousel__slide" aria-label="item-{{$index}} {{- with or .text .alt .credit }} | {{ . | plainify }} {{- end }}" {{ end }}>
{{ partial "commons/image.html"
(dict
"image" .id
......
......@@ -4,7 +4,7 @@
{{- $image := partial "GetMedia" .id -}}
{{- $image_class := printf "image-%s" (partial "GetImageDirection" .) -}}
{{- if $image -}}
<figure class="{{ $image_class }}">
<figure role="figure" class="{{ $image_class }}" {{- with or .text .alt .credit }} aria-label="{{ . | plainify }}" {{ end }}>
{{ partial "commons/image.html"
(dict
"image" .file
......
......@@ -17,7 +17,7 @@
)}}
{{- with .image -}}
<figure class="{{ $image_class }}">
<figure role="figure" class="{{ $image_class }}" {{- with or $text .alt .credit }} aria-label="{{ . | plainify }}" {{ end }}>
{{ if not site.Params.image_sizes.design_system.lightbox.disabled }}
<a class="glightbox"
role="button"
......
<figure {{- if .is_carousel }} id="carousel-item-{{.index}}" role="{{.role}}" aria-roledescription="slide" class="carousel__slide" aria-label="{{.index}} / {{ .total }}" {{ end }} class="{{ if .is_carousel }}carousel__slide{{ end }} {{ if .params.photo }}with-picture{{ end }}">
<figure role="figure" {{- if .is_carousel }} id="carousel-item-{{.index}}" role="{{.role}}" aria-roledescription="slide" class="carousel__slide" aria-label="{{.index}} / {{ .total }}" {{ end }} class="{{ if .is_carousel }}carousel__slide{{ end }} {{ if .params.photo }}with-picture{{ end }}">
{{ with .params }}
{{ $is_long := gt (len .text) 150 }}
<blockquote {{- if $is_long }} class="is-long" {{- end }}>
......
<footer id="document-footer">
<footer id="document-footer" role="contentinfo">
{{ partial "footer/footer-simple.html" . }}
</footer>
{{ $primary := partial "GetMenu" "primary" }}
<header id="document-header">
<header id="document-header" role="banner">
<nav aria-label="{{ i18n "commons.menu.main" }}">
<div class="container">
{{ partial "header/logo.html" }}
......
{{ if . }}
<figure class="featured-image">
<figure role="figure" class="featured-image">
{{ partial "commons/image.html"
(dict
"image" .
......
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