Skip to content

Commit

Permalink
shortcodes: intermediately use random ids instead of .Ordinal #543
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed May 25, 2023
1 parent f0434c3 commit 47f85b4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion layouts/_default/_markup/render-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/expand.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/openapi.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion layouts/shortcodes/swagger.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion layouts/shortcodes/tabs.html
Original file line number Diff line number Diff line change
@@ -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")
) }}

0 comments on commit 47f85b4

Please sign in to comment.