From ecaf84c7c79c1b4bcf22e19b8b2fd30fbf3489af Mon Sep 17 00:00:00 2001 From: Reorx Date: Wed, 18 May 2022 14:24:29 +0800 Subject: refactor social-quote-tweet and social_links to use social_quote_tweet partial --- layouts/shortcodes/social-quote-tweet.html | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'layouts/shortcodes') 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 @@ -
-
- {{ safeHTML (index $.Site.Data.svg "twitter-simple") }} - {{ with .Inner }}{{ . }}{{ end }} -
- {{ $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 "" "" $json.html | safeHTML -}} -
+{{ partial "social_quote_tweet.html" (dict "user" (.Get "user") "id" (.Get "id") "title" .Inner) }} -- cgit v1.2.3