diff --git a/config.yaml b/config.yaml index a931be1924db1218ca5f16f74d599c849fb62837..090f7c8bb5508ec8e7ee382bf620597cb9a2e513 100644 --- a/config.yaml +++ b/config.yaml @@ -41,6 +41,7 @@ params: image_sizes: design_system: lightbox: + disabled: false # TODO mobile et tablet mobile: 1920x2560 tablet: 1920x2560 diff --git a/layouts/partials/blocks/templates/gallery/carousel.html b/layouts/partials/blocks/templates/gallery/carousel.html index a787ab3f2ef92ef36950e507f2c1c6b44f7bb5b9..761d2008b8b2b6d48dbcc85c1f307850bcfc2ad9 100644 --- a/layouts/partials/blocks/templates/gallery/carousel.html +++ b/layouts/partials/blocks/templates/gallery/carousel.html @@ -14,18 +14,21 @@ {{- $image := partial "GetMedia" .file -}} {{- if $image -}} <figure{{ if $is_carousel }} class="splide__slide"{{ end }}> - <a class="glightbox" - data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" - href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" - title="{{- i18n "commons.lightbox.link.title" -}}" - > - {{ partial "commons/image.html" - (dict - "image" .id - "alt" .alt - "sizes" site.Params.image_sizes.blocks.gallery.carousel - )}} - </a> + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + <a class="glightbox" + data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" + href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" + title="{{- i18n "commons.lightbox.link.title" -}}"> + {{ end }} + {{ partial "commons/image.html" + (dict + "image" .id + "alt" .alt + "sizes" site.Params.image_sizes.blocks.gallery.carousel + )}} + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + </a> + {{ end }} {{ if or .text .credit }} <figcaption> {{ if .text }} diff --git a/layouts/partials/blocks/templates/gallery/grid.html b/layouts/partials/blocks/templates/gallery/grid.html index fe5a4a1cc4da6785a27e3580bbce659156c2c5f2..84af74fa5ca3ba9168d5c75220820f829a99d735 100644 --- a/layouts/partials/blocks/templates/gallery/grid.html +++ b/layouts/partials/blocks/templates/gallery/grid.html @@ -4,18 +4,21 @@ {{- $image := partial "GetMedia" .id -}} {{- if $image -}} <figure> - <a class="glightbox" - data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" - href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" - title="{{- i18n "commons.lightbox.link.title" -}}" - > + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + <a class="glightbox" + data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" + href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" + title="{{- i18n "commons.lightbox.link.title" -}}"> + {{ end }} {{ partial "commons/image.html" (dict "image" .file "alt" .alt "sizes" site.Params.image_sizes.blocks.gallery.grid )}} - </a> + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + </a> + {{ end }} {{ if .text }} <figcaption> {{- partial "PrepareHTML" .text -}} diff --git a/layouts/partials/blocks/templates/image.html b/layouts/partials/blocks/templates/image.html index 2bc4ef561c90b319677aa6348178501b123eeada..e09bcf52f6a5322c6ef2cb6b68d071c8175ed956 100644 --- a/layouts/partials/blocks/templates/image.html +++ b/layouts/partials/blocks/templates/image.html @@ -21,18 +21,21 @@ {{- with .image -}} <figure class="{{ $image_class }}"> - <a class="glightbox" - data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" - href="{{- partial "GetLightboxUrl" . -}}" - title="{{- i18n "commons.lightbox.link.title" -}}" - > - {{ partial "commons/image.html" - (dict - "image" . - "alt" .alt - "sizes" site.Params.image_sizes.blocks.image - )}} - </a> + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + <a class="glightbox" + data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" + href="{{- partial "GetLightboxUrl" . -}}" + title="{{- i18n "commons.lightbox.link.title" -}}"> + {{ end }} + {{ partial "commons/image.html" + (dict + "image" . + "alt" .alt + "sizes" site.Params.image_sizes.blocks.image + )}} + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + </a> + {{ end }} <figcaption> {{- if $text }} {{ partial "PrepareHTML" $text }} diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index b01e30716032d106215437e43c63cd7b2052b795..14bee13d73d3e0d97089956e4b20c3f398bf2352 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -22,18 +22,21 @@ {{- end -}} {{- if .image }} <figure> - <a class="glightbox" - data-glightbox="type: image;{{ if .image.credit }}description: {{ partial "PrepareHTML" .image.credit }}{{ end }}" - href="{{ partial "GetLightboxUrl" .image }}" - title="{{- i18n "commons.lightbox.link.title" -}}" - > + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + <a class="glightbox" + data-glightbox="type: image;{{ if .image.credit }}description: {{ partial "PrepareHTML" .image.credit }}{{ end }}" + href="{{ partial "GetLightboxUrl" .image }}" + title="{{- i18n "commons.lightbox.link.title" -}}"> + {{ end }} {{ partial "commons/image.html" (dict "image" .image "sizes" ( .sizes | default site.Params.image_sizes.design_system.hero ) "lazy" false ) }} + {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} </a> + {{ end }} {{ if partial "GetTextFromHTML" .image.credit }} <figcaption tabindex="0"> <p>