tpl: Add "param" shortcode

Fixes #4010
This commit is contained in:
Bjørn Erik Pedersen
2018-11-27 16:53:11 +01:00
parent aded0f25fd
commit f37c5a2567
3 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
{{- $name := (.Get 0) -}}
{{- with $name -}}
{{- with ($.Page.Param .) }}{{ . }}{{ else }}{{ errorf "Param %q not found: %s" $name $.Position }}{{ end -}}
{{- else }}{{ errorf "Missing param key: %s" $.Position }}{{ end -}}