PaperModX/layouts/shortcodes/tweet-ref.html

11 lines
381 B
HTML
Raw Permalink Normal View History

<div class="tweet-ref">
{{- $url := .Get 0 -}}
From <a href="{{ $url }}">{{ strings.TrimPrefix "https://" $url }}</a>:
{{- $dnt := true -}}
{{- $query := querify "url" $url "dnt" $dnt -}}
{{- $request := printf "https://publish.twitter.com/oembed?%s" $query -}}
{{- $json := getJSON $request -}}
{{- replaceRE "<script.+/script>" "" $json.html | safeHTML -}}
</div>