diff --git a/themes/psh-docs/layouts/shortcodes/version/only.html b/themes/psh-docs/layouts/shortcodes/version/only.html new file mode 100644 index 0000000000..8154e7226f --- /dev/null +++ b/themes/psh-docs/layouts/shortcodes/version/only.html @@ -0,0 +1,10 @@ + + + + + + +{{- $version := .Site.Params.vendor.config.version -}} +{{- if eq $version ( int (.Get 0)) -}} + {{- .Inner | .Page.RenderString -}} +{{- end -}} diff --git a/themes/psh-docs/layouts/shortcodes/version/specific.html b/themes/psh-docs/layouts/shortcodes/version/specific.html new file mode 100644 index 0000000000..0ff1c4dcd1 --- /dev/null +++ b/themes/psh-docs/layouts/shortcodes/version/specific.html @@ -0,0 +1,18 @@ + + + + + + + + + +{{- $page := .Page -}} +{{- $version := .Site.Params.vendor.config.version -}} +{{- $splitVersionChar := "<--->" -}} +{{- range $k, $v := split .Inner $splitVersionChar -}} + {{- $current := add $k 1 -}} + {{- if eq $current $version -}} +{{- $v | $page.RenderString -}} + {{- end -}} +{{- end -}}