From 5fd3fdbd75b83fd83cea063ba0d1be528edd6d1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Thu, 25 May 2023 12:43:10 +0200 Subject: [PATCH] shortcodes: fix Hugo version check --- layouts/_default/_markup/render-image.html | 2 +- layouts/shortcodes/expand.html | 2 +- layouts/shortcodes/openapi.html | 2 +- layouts/shortcodes/swagger.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 0bda2dd528..40832d6164 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -2,7 +2,7 @@ {{- $major := int (index $version 0) }} {{- $minor := int (index $version 1) }} {{- $id := "" }} -{{- if and (ge $major 0) (ge $major 108) }} +{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} {{- $id = .Ordinal }} {{- end }} {{- partial "shortcodes/image.html" (dict diff --git a/layouts/shortcodes/expand.html b/layouts/shortcodes/expand.html index 7a1d7c2bc5..3473f3ea7f 100644 --- a/layouts/shortcodes/expand.html +++ b/layouts/shortcodes/expand.html @@ -3,7 +3,7 @@ {{- $major := int (index $version 0) }} {{- $minor := int (index $version 1) }} {{- $id := "" }} -{{- if and (ge $major 0) (ge $major 108) }} +{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} {{- $id = .Ordinal }} {{- end }} {{- partial "shortcodes/expand.html" (dict diff --git a/layouts/shortcodes/openapi.html b/layouts/shortcodes/openapi.html index 3842857f5b..e5a490c427 100644 --- a/layouts/shortcodes/openapi.html +++ b/layouts/shortcodes/openapi.html @@ -2,7 +2,7 @@ {{- $major := int (index $version 0) }} {{- $minor := int (index $version 1) }} {{- $id := "" }} -{{- if and (ge $major 0) (ge $major 108) }} +{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} {{- $id = .Ordinal }} {{- end }} {{- partial "shortcodes/openapi.html" (dict diff --git a/layouts/shortcodes/swagger.html b/layouts/shortcodes/swagger.html index c96b2b424d..3811d76052 100644 --- a/layouts/shortcodes/swagger.html +++ b/layouts/shortcodes/swagger.html @@ -2,7 +2,7 @@ {{- $major := int (index $version 0) }} {{- $minor := int (index $version 1) }} {{- $id := "" }} -{{- if and (ge $major 0) (ge $major 108) }} +{{- if or (and (eq $major 0) (ge $minor 108)) (gt $major 0) }} {{- $id = .Ordinal }} {{- end }} {{- partial "shortcodes/swagger.html" (dict