From 47f85b4eb1af1d2c36bd5a1cc1975884763eb644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Thu, 25 May 2023 15:45:57 +0200 Subject: [PATCH] shortcodes: intermediately use random ids instead of .Ordinal #543 --- layouts/_default/_markup/render-image.html | 2 +- layouts/shortcodes/expand.html | 2 +- layouts/shortcodes/openapi.html | 2 +- layouts/shortcodes/swagger.html | 2 +- layouts/shortcodes/tabs.html | 9 ++++++++- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 40832d6164..bb4f848b4a 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -3,7 +3,7 @@ {{- $minor := int (index $version 1) }} {{- $id := "" }} {{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} - {{- $id = .Ordinal }} + {{- $id = "" }} {{- end }} {{- partial "shortcodes/image.html" (dict "context" .Page diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html index 3473f3ea7f..caa3d9561f 100644 --- a/layouts/shortcodes/expand.html +++ b/layouts/shortcodes/expand.html @@ -4,7 +4,7 @@ {{- $minor := int (index $version 1) }} {{- $id := "" }} {{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} - {{- $id = .Ordinal }} + {{- $id = "" }} {{- end }} {{- partial "shortcodes/expand.html" (dict "context" .Page diff --git a/layouts/shortcodes/openapi.html b/layouts/shortcodes/openapi.html index e5a490c427..69a529bef4 100644 --- a/layouts/shortcodes/openapi.html +++ b/layouts/shortcodes/openapi.html @@ -3,7 +3,7 @@ {{- $minor := int (index $version 1) }} {{- $id := "" }} {{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} - {{- $id = .Ordinal }} + {{- $id = "" }} {{- end }} {{- partial "shortcodes/openapi.html" (dict "context" .Page diff --git a/layouts/shortcodes/swagger.html b/layouts/shortcodes/swagger.html index 3811d76052..7d06c9065e 100644 --- a/layouts/shortcodes/swagger.html +++ b/layouts/shortcodes/swagger.html @@ -3,7 +3,7 @@ {{- $minor := int (index $version 1) }} {{- $id := "" }} {{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} - {{- $id = .Ordinal }} + {{- $id = "" }} {{- end }} {{- partial "shortcodes/swagger.html" (dict "context" .Page diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html index c8eb0f70ab..5b492faab6 100644 --- a/layouts/shortcodes/tabs.html +++ b/layouts/shortcodes/tabs.html @@ -1,6 +1,13 @@ {{- $unused := .Inner }} +{{- $version := split hugo.Version "." }} +{{- $major := int (index $version 0) }} +{{- $minor := int (index $version 1) }} +{{- $groupid := ((.Get "groupid") | default ((.Get "groupId") | default "")) }} +{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} + {{- $groupid = $groupid | default "" }} +{{- end }} {{- partial "shortcodes/tabs.html" (dict "context" .Page - "groupid" ((.Get "groupid") | default (.Get "groupId")) + "groupid" $groupid "content" (.Scratch.Get "tabs") ) }} \ No newline at end of file