Support DNT in Twitter shortcode for GDPR

Fixes #4765
This commit is contained in:
Bjørn Erik Pedersen
2018-05-24 12:25:52 +02:00
parent 3bfe8f4be6
commit 9753cb59f1
4 changed files with 12 additions and 2 deletions

View File

@@ -1,4 +1,6 @@
{{- $pc := .Page.Site.Config.Privacy.Twitter -}}
{{- if not $pc.Disable -}}
{{ (getJSON "https://api.twitter.com/1/statuses/oembed.json?id=" (index .Params 0)).html | safeHTML }}
{{ $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%s&dnt=%t" (index .Params 0) $pc.EnableDNT }}
{{ $json := getJSON $url }}
{{ $json.html | safeHTML }}
{{- end -}}