shortcodes: intermediately use random ids instead of .Ordinal #543

This commit is contained in:
Sören Weber 2023-05-25 15:45:57 +02:00
parent f0434c3379
commit 47f85b4eb1
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
5 changed files with 12 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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")
) }}