From 96fdb6db8b8d0bc5b89dd7e50ef1a9c992fda70a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Thu, 17 Aug 2023 22:01:42 +0100 Subject: [PATCH] updated logic for unique ids in shortcodes --- layouts/shortcodes/carousel.html | 3 +-- layouts/shortcodes/chart.html | 2 +- layouts/shortcodes/gallery.html | 2 +- layouts/shortcodes/typeit.html | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/layouts/shortcodes/carousel.html b/layouts/shortcodes/carousel.html index 742bb747..1f424a1d 100644 --- a/layouts/shortcodes/carousel.html +++ b/layouts/shortcodes/carousel.html @@ -1,5 +1,4 @@ -{{ $time := now.UnixNano }} -{{ $id := delimit (slice "gallery" $time) "-" }} +{{ $id := delimit (slice "carousel" .Ordinal now.UnixNano) "-" }} {{ $aspect := default "16-9" (.Get "aspectRatio") }} {{ $images := .Page.Resources.Match (.Get "images") }} {{ $interval := default "2000" (.Get "interval") }} diff --git a/layouts/shortcodes/chart.html b/layouts/shortcodes/chart.html index 98ae8fa7..82c92aad 100644 --- a/layouts/shortcodes/chart.html +++ b/layouts/shortcodes/chart.html @@ -1,5 +1,5 @@ +{{ $id := delimit (slice "chart" .Ordinal now.UnixNano) "-" }}
- {{ $id := delimit (shuffle (seq 1 9)) "" }}