mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Support typed bool, int and float in shortcode params
This means that you now can do: {{< vidur 9KvBeKu false true 32 3.14 >}} And the boolean and numeric values will be converted to `bool`, `int` and `float64`. If you want these to be strings, they must be quoted: {{< vidur 9KvBeKu "false" "true" "32" "3.14" >}} Fixes #6371
This commit is contained in:
2
tpl/tplimpl/embedded/templates.autogen.go
generated
2
tpl/tplimpl/embedded/templates.autogen.go
generated
@@ -422,7 +422,7 @@ if (!doNotTrack) {
|
||||
{{- if $pc.Simple -}}
|
||||
{{ template "_internal/shortcodes/twitter_simple.html" . }}
|
||||
{{- else -}}
|
||||
{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%s&dnt=%t" (index .Params 0) $pc.EnableDNT -}}
|
||||
{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%v&dnt=%t" (index .Params 0) $pc.EnableDNT -}}
|
||||
{{- $json := getJSON $url -}}
|
||||
{{ $json.html | safeHTML }}
|
||||
{{- end -}}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
{{- if $pc.Simple -}}
|
||||
{{ template "_internal/shortcodes/twitter_simple.html" . }}
|
||||
{{- else -}}
|
||||
{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%s&dnt=%t" (index .Params 0) $pc.EnableDNT -}}
|
||||
{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%v&dnt=%t" (index .Params 0) $pc.EnableDNT -}}
|
||||
{{- $json := getJSON $url -}}
|
||||
{{ $json.html | safeHTML }}
|
||||
{{- end -}}
|
||||
|
Reference in New Issue
Block a user