summaryrefslogtreecommitdiffstats
path: root/site/layouts/shortcodes/param.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-24 12:33:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-24 12:33:51 +0000
commit3ea39841c8049525e31e9f4d6300f0c60cdb42de (patch)
tree855de60a8872eafb5911acd303aedcdbfe713a73 /site/layouts/shortcodes/param.html
parentInital commit. (diff)
downloadbootstrap-html-3ea39841c8049525e31e9f4d6300f0c60cdb42de.tar.xz
bootstrap-html-3ea39841c8049525e31e9f4d6300f0c60cdb42de.zip
Adding upstream version 5.2.3+dfsg.upstream/5.2.3+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'site/layouts/shortcodes/param.html')
-rw-r--r--site/layouts/shortcodes/param.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/site/layouts/shortcodes/param.html b/site/layouts/shortcodes/param.html
new file mode 100644
index 0000000..34ad00c
--- /dev/null
+++ b/site/layouts/shortcodes/param.html
@@ -0,0 +1,14 @@
+{{- /*
+ Work around wrong escapes in integrity attributes.
+ Original: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/shortcodes/param.html
+*/ -}}
+
+{{- $name := .Get 0 -}}
+{{- with $name -}}
+{{- $value := $.Page.Param . -}}
+{{- /* If any parameter ends with `_hash`, mark the string as safe HTML */ -}}
+{{- if (strings.HasSuffix $name "_hash") -}}
+ {{- $value = $value | safeHTML -}}
+{{- end -}}
+{{- with $value }}{{ . }}{{ else }}{{ errorf "Param %q not found: %s" $name $.Position }}{{ end -}}
+{{- else }}{{ errorf "Missing param key: %s" $.Position }}{{ end -}}