hugo/tpl/tplimpl/embedded/templates/shortcodes/twitter.html

10 lines
369 B
HTML
Raw Normal View History

{{- $pc := .Page.Site.Config.Privacy.Twitter -}}
{{- if not $pc.Disable -}}
2018-05-30 20:42:32 +00:00
{{- if $pc.Simple -}}
{{ template "_internal/shortcodes/twitter_simple.html" . }}
{{- else -}}
{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%v&dnt=%t" (index .Params 0) $pc.EnableDNT -}}
2018-05-24 11:03:23 +00:00
{{- $json := getJSON $url -}}
{{ $json.html | safeHTML }}
2018-05-30 20:42:32 +00:00
{{- end -}}
{{- end -}}