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/partials/social_links.html | 23 +++++------------------ layouts/partials/social_quote_tweet.html | 13 +++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 layouts/partials/social_quote_tweet.html (limited to 'layouts/partials') diff --git a/layouts/partials/social_links.html b/layouts/partials/social_links.html index 5eaee1c..e0f5415 100644 --- a/layouts/partials/social_links.html +++ b/layouts/partials/social_links.html @@ -1,20 +1,7 @@ - -{{- define "render-tweet" -}} - {{- $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 -}} -{{- end -}} diff --git a/layouts/partials/social_quote_tweet.html b/layouts/partials/social_quote_tweet.html new file mode 100644 index 0000000..b3068aa --- /dev/null +++ b/layouts/partials/social_quote_tweet.html @@ -0,0 +1,13 @@ + -- cgit v1.2.3