mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-04-17 10:50:58 +00:00
Add a param shortcode to work around the escaped characters in hashes
This commit is contained in:
parent
2bd3bd842d
commit
f979307833
1 changed files with 12 additions and 0 deletions
12
site/layouts/shortcodes/param.html
Normal file
12
site/layouts/shortcodes/param.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{{- /*
|
||||
Work around wrong escapes in integrity attributes.
|
||||
*/ -}}
|
||||
|
||||
{{- $name := .Get 0 -}}
|
||||
{{- with $name -}}
|
||||
{{- $value := $.Page.Param . -}}
|
||||
{{- if in $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 -}}
|
||||
Loading…
Reference in a new issue