From 5e4fc68d6e12b7f8940512b3f1a40d9cd8011477 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:00:31 +0200 Subject: [PATCH 1/2] hugo: use i18n string for 'caution' alerts While we don't currently use the caution alert anywhere yet, we should still be consistent in using i18n strings for these (not `title .AlertType`). Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- i18n/en.yaml | 1 + layouts/_default/_markup/render-blockquote.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/i18n/en.yaml b/i18n/en.yaml index fe37067f13..32d25ee84f 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -17,6 +17,7 @@ important: Important note: Note tip: Tip warning: Warning +caution: Caution ## openapi strings: diff --git a/layouts/_default/_markup/render-blockquote.html b/layouts/_default/_markup/render-blockquote.html index dbc10f9996..e82786d5e5 100644 --- a/layouts/_default/_markup/render-blockquote.html +++ b/layouts/_default/_markup/render-blockquote.html @@ -28,7 +28,7 @@ {{ $i := index $icons .AlertType }} {{ partialCached "icon.html" $i $i }} - {{ or (i18n .AlertType) (title .AlertType) }} + {{ i18n .AlertType }}
{{ .Text | safeHTML }} From 3249110cdf519492b694aecd04d21debc4e3e3c8 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Wed, 11 Sep 2024 15:07:52 +0200 Subject: [PATCH 2/2] hugo: use i18n strings in 'experimental' and 'restricted' shortcodes Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- layouts/shortcodes/experimental.html | 2 +- layouts/shortcodes/restricted.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/shortcodes/experimental.html b/layouts/shortcodes/experimental.html index b1aa1f37bc..9e8ac45809 100644 --- a/layouts/shortcodes/experimental.html +++ b/layouts/shortcodes/experimental.html @@ -3,7 +3,7 @@ {{ partialCached "icon.html" "science" "science" }} - {{ .Get "title" | default "Experimental" }} + {{ .Get "title" | default (i18n "experimental") }} {{ .InnerDeindent | safe.HTML }} diff --git a/layouts/shortcodes/restricted.html b/layouts/shortcodes/restricted.html index 8256d2b9e1..befd5c4dbf 100644 --- a/layouts/shortcodes/restricted.html +++ b/layouts/shortcodes/restricted.html @@ -3,7 +3,7 @@ {{ partialCached "icon.html" "rocket_launch" "rocket_launch" }} - {{ .Get "title" | default "Restricted" }} + {{ .Get "title" | default (i18n "restricted") }} {{ .InnerDeindent | safe.HTML }}