diff --git a/blog/layouts/partials/social-share.html b/blog/layouts/partials/social-share.html new file mode 100644 index 0000000..313d0ff --- /dev/null +++ b/blog/layouts/partials/social-share.html @@ -0,0 +1,27 @@ +{{/* + Copied and adapted from Ananke theme's implementation, removing `.Site.Social` as that is deprecated. + */}} +{{ $title := .Title }} +{{ $url := printf "%s" .Permalink | absLangURL }} + +{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }} +{{ $twitter_href := printf "https://twitter.com/intent/tweet?url=%s&text=%s" $url $title }} +{{ with site.params.twitter }} + {{ $twitter_href = printf "%s&via=%s" $twitter_href . }} +{{ end }} +{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }} +{{ $hrefs := dict "facebook" $facebook_href "twitter" $twitter_href "linkedin" $linkedin_href }} + +{{ $services := where (partialCached "func/socials/Get" "socials/Get") "share" true }} +{{ if not ($.Param "disable_share") }} +
+ {{ range $service := $services }} + {{ $href := index $hrefs .name }} + + {{ with .icon }} + {{ . }} + {{ end }} + + {{ end }} +
+{{ end }} diff --git a/blog/themes/ananke b/blog/themes/ananke index f4131c5..8e1a6dc 160000 --- a/blog/themes/ananke +++ b/blog/themes/ananke @@ -1 +1 @@ -Subproject commit f4131c5efe2702c68347633bcb596ece78d9af2d +Subproject commit 8e1a6dc21313d3a765f122c2bd76bdc8ad174e67