This commit is contained in:
Jack Jackson 2024-12-28 14:57:38 -08:00
parent 122e87c70c
commit 501700c31b

View File

@ -6,20 +6,21 @@
{{ $facebook_href := printf "https://www.facebook.com/sharer.php?u=%s" $url }} {{ $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 }} {{ $twitter_href := printf "https://twitter.com/intent/tweet?url=%s&text=%s" $url $title }}
{{ $twitter_href = printf "%s&via=%s" %twitter_href .Site.Param "twitter" }} {{ $twitter_href = printf "%s&via=%s" $twitter_href .Site.Param "twitter" }}
{{ $linkedin_href := printf "https://www.linkedin.com/shareArticle?mini=true&url=%s&title=%s" $url $title }} {{ $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 }} {{ $hrefs := dict "facebook" $facebook_href "twitter" $twitter_href "linkedin" $linkedin_href }}
{{ $services := where (partialCached "func/socials/Get" "socials/Get") "share" true }} {{ $services := where (partialCached "func/socials/Get" "socials/Get") "share" true }}
{{ if not ($.Param "disable_share") }} {{ if not ($.Param "disable_share") }}
<div id="sharing" class="mt3 ananke-socials"> <div id="sharing" class="mt3 ananke-socials">
{{ range $service := $services }} {{ range $service := $services }}
{{ $href := index $hrefs .name }} {{ $href := index $hrefs .name }}
<a href="{{ $href }}" class="ananke-social-link {{ .name }} no-underline" aria-label="share on {{ .label }}"> <a href="{{ $href }}" class="ananke-social-link {{ .name }} no-underline" aria-label="share on {{ .label }}">
{{ with .icon }} {{ with .icon }}
<span class="icon"> {{ . }}</span> <span class="icon"> {{ . }}</span>
{{ end }}
</a>
{{ end }} {{ end }}
</a> </div>
{{ end }}
</div>
{{ end }} {{ end }}