diff --git a/assets/js/lightbox.js b/assets/js/lightbox.js index 18e1111..181fcc1 100644 --- a/assets/js/lightbox.js +++ b/assets/js/lightbox.js @@ -52,7 +52,7 @@ if (gallery) { el.setAttribute("rel", "noopener"); el.setAttribute("title", params.downloadTitle || "Download"); pswp.on("change", () => { - el.href = pswp.currSlide.data.element.href; + el.href = pswp.currSlide.data.element.children[0].href; }); }, }); diff --git a/layouts/partials/gallery.html b/layouts/partials/gallery.html index 48fbafc..3dde8c3 100644 --- a/layouts/partials/gallery.html +++ b/layouts/partials/gallery.html @@ -13,10 +13,13 @@ {{/* Title from front matter */}} {{ $title = $image.Title }} {{ end }} + {{ $video := "" }} + {{ $video = $image.Params.video }} {{ $images = $images | append (dict "Name" $image.Name "Title" $title "image" $image + "Video" $video ) }} {{ end }} @@ -25,7 +28,9 @@ {{ $thumbnail := $image.Filter (slice images.AutoOrient (images.Process "fit 600x600")) }} {{ $full := $image.Filter (slice images.AutoOrient (images.Process "fit 1600x1600")) }} {{ $color := index $thumbnail.Colors 0 | default "transparent" }} - + {{ $title_html := partial "image_title.html" . }} + {{ end }}