From 33343e169db0954be7385133600589ee0cde2a46 Mon Sep 17 00:00:00 2001 From: Olivia206 <olivia.simonet206@gmail.com> Date: Thu, 15 Feb 2024 10:57:33 +0100 Subject: [PATCH] added text to carousel gallery --- layouts/partials/blocks/templates/gallery/carousel.html | 8 +++++++- layouts/partials/header/hero.html | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/layouts/partials/blocks/templates/gallery/carousel.html b/layouts/partials/blocks/templates/gallery/carousel.html index 3e838f5b..f66f8709 100644 --- a/layouts/partials/blocks/templates/gallery/carousel.html +++ b/layouts/partials/blocks/templates/gallery/carousel.html @@ -21,9 +21,15 @@ "sizes" site.Params.image_sizes.blocks.gallery.carousel )}} {{ if not site.Params.image_sizes.design_system.lightbox.disabled }} + {{ $lightbox_text := false }} + {{ if and .text .credit }} + {{ $lightbox_text = delimit (slice .text .credit) " / " }} + {{ else }} + {{ $lightbox_text = or .text .credit }} + {{ end }} <a class="glightbox" role="button" - data-glightbox="type: image;{{ if .credit }}description: {{ partial "PrepareHTML" .credit }}{{ end }}" + data-glightbox="type: image;{{ if $lightbox_text }}description: {{ partial "PrepareHTML" $lightbox_text }}{{ end }}" href="{{ partial "GetLightboxUrl" (dict "id" .id) }}" title="{{- i18n "commons.lightbox.link.title" -}}" aria-label="{{- i18n "commons.lightbox.link.title" -}}"> diff --git a/layouts/partials/header/hero.html b/layouts/partials/header/hero.html index 4d62d61a..2848940f 100644 --- a/layouts/partials/header/hero.html +++ b/layouts/partials/header/hero.html @@ -11,8 +11,8 @@ {{ if not $subtitle }} {{ if and (eq site.Params.summary.position "hero") $summary }} - {{ $subtitle = $summary }} - {{ $subtitle_is_summary = true }} + {{ $subtitle = $summary }} + {{ $subtitle_is_summary = true }} {{ end }} {{ end }} -- GitLab