diff options
| author | Reorx <novoreorx@gmail.com> | 2022-05-18 14:24:29 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-05-18 14:24:29 +0800 |
| commit | ecaf84c7c79c1b4bcf22e19b8b2fd30fbf3489af (patch) | |
| tree | aa479732f0cdbea0e3ba998a1b7fcc66f0d3c54b /layouts/shortcodes | |
| parent | 7c253d3fee18ff79c1fd446126bc577cb2658456 (diff) | |
refactor social-quote-tweet and social_links to use social_quote_tweet partial
Diffstat (limited to 'layouts/shortcodes')
| -rw-r--r-- | layouts/shortcodes/social-quote-tweet.html | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/layouts/shortcodes/social-quote-tweet.html b/layouts/shortcodes/social-quote-tweet.html index d8b21ca..205f0a9 100644 --- a/layouts/shortcodes/social-quote-tweet.html +++ b/layouts/shortcodes/social-quote-tweet.html @@ -1,16 +1 @@ -<div class="tweet social-quote"> - <div class="title"> - {{ safeHTML (index $.Site.Data.svg "twitter-simple") }} - {{ with .Inner }}<span>{{ . }}</span>{{ end }} - </div> - {{ $user := .Get "user" }} - {{ $id := .Get "id" }} - {{ $dnt := true }} - {{- .Inner -}}{{/* not required, only to not break Obsidian highlight by adding `/` before `>` */}} - - {{- $url := printf "https://twitter.com/%v/status/%v" $user $id -}} - {{- $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> +{{ partial "social_quote_tweet.html" (dict "user" (.Get "user") "id" (.Get "id") "title" .Inner) }} |
