1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-31 17:11:48 +02:00

Minor shortcode tweaks and consistency changes

This commit is contained in:
XhmikosR
2021-01-16 21:51:12 +02:00
parent 9050b2698a
commit 5cc633dfab
7 changed files with 37 additions and 33 deletions

View File

@@ -1,11 +1,13 @@
{{- /*
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 in $name "_hash" -}}
{{- /* 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 -}}