mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 01:33:04 +00:00
shortcodes: intermediately use random ids instead of .Ordinal #543
This commit is contained in:
parent
f0434c3379
commit
47f85b4eb1
5 changed files with 12 additions and 5 deletions
|
@ -3,7 +3,7 @@
|
||||||
{{- $minor := int (index $version 1) }}
|
{{- $minor := int (index $version 1) }}
|
||||||
{{- $id := "" }}
|
{{- $id := "" }}
|
||||||
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
||||||
{{- $id = .Ordinal }}
|
{{- $id = "" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- partial "shortcodes/image.html" (dict
|
{{- partial "shortcodes/image.html" (dict
|
||||||
"context" .Page
|
"context" .Page
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
{{- $minor := int (index $version 1) }}
|
{{- $minor := int (index $version 1) }}
|
||||||
{{- $id := "" }}
|
{{- $id := "" }}
|
||||||
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
||||||
{{- $id = .Ordinal }}
|
{{- $id = "" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- partial "shortcodes/expand.html" (dict
|
{{- partial "shortcodes/expand.html" (dict
|
||||||
"context" .Page
|
"context" .Page
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{- $minor := int (index $version 1) }}
|
{{- $minor := int (index $version 1) }}
|
||||||
{{- $id := "" }}
|
{{- $id := "" }}
|
||||||
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
||||||
{{- $id = .Ordinal }}
|
{{- $id = "" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- partial "shortcodes/openapi.html" (dict
|
{{- partial "shortcodes/openapi.html" (dict
|
||||||
"context" .Page
|
"context" .Page
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
{{- $minor := int (index $version 1) }}
|
{{- $minor := int (index $version 1) }}
|
||||||
{{- $id := "" }}
|
{{- $id := "" }}
|
||||||
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }}
|
||||||
{{- $id = .Ordinal }}
|
{{- $id = "" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- partial "shortcodes/swagger.html" (dict
|
{{- partial "shortcodes/swagger.html" (dict
|
||||||
"context" .Page
|
"context" .Page
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
{{- $unused := .Inner }}
|
{{- $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
|
{{- partial "shortcodes/tabs.html" (dict
|
||||||
"context" .Page
|
"context" .Page
|
||||||
"groupid" ((.Get "groupid") | default (.Get "groupId"))
|
"groupid" $groupid
|
||||||
"content" (.Scratch.Get "tabs")
|
"content" (.Scratch.Get "tabs")
|
||||||
) }}
|
) }}
|
Loading…
Reference in a new issue