This repository has been archived on 2023-08-03. You can view files and clone it, but cannot push or open issues or pull requests.
sito-web/layouts/partials/socialshare.html

73 lines
2.2 KiB
HTML

<hr>
<!-- Social Share Button HTML -->
{{ $title := .Title }}
{{ $url := printf "%s" .Permalink }}
{{ $body := print $title ", by " .Site.Title "\n" .Params.description "\n\n" $url "\n" }}
<i class="fa fa-share"></i> Condividi questo contenuto:
<div class="social-share">
<ul class="share-icons">
<!-- Mastodon -->
{{ if .Site.Params.socialshare.mastodon }}
<li>
<a href="https://mastodon.uno/share?text={{ .Title }}, {{ .Permalink }}" target="_blank" class="share-btn mastodon">
<i class="fa fa-mastodon"></i>
<p>Mastodon</p>
</a>
</li>
{{ end }}
<!-- Twitter -->
{{ if .Site.Params.socialshare.twitter }}
<li>
<a href="https://twitter.com/intent/tweet?url={{ .Permalink }}&amp;text={{ .Title }}, " target="_blank" rel="noopener" aria-label="Share on Twitter" class="share-btn twitter">
<i class="fa fa-twitter"></i>
<p>Twitter</p>
</a>
</li>
{{ end }}
<!-- Facebook -->
{{ if .Site.Params.socialshare.facebook }}
<li>
<a href="https://www.facebook.com/sharer.php?u={{ $url }}" target="_blank" rel="noopener" aria-label="Share on Facebook" class="share-btn facebook">
<i class="fa fa-facebook"></i>
<p>Facebook</p>
</a>
</li>
{{ end }}
<!-- LinkedIn -->
{{ if .Site.Params.socialshare.linkedin }}
<li>
<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{ $url }}&amp;source={{ $url }}&amp;title={{ $title }}&amp;summary={{ $title }}" target="_blank" rel="noopener" aria-label="Share on LinkedIn" class="share-btn linkedin">
<i class="fa fa-linkedin"></i>
<p>LinkedIn</p>
</a>
</li>
{{ end }}
<!-- WhatsApp -->
{{ if .Site.Params.socialshare.whatsapp }}
<li>
<a href="whatsapp://send?text={{ $body }}" target="_blank" class="share-btn whatsapp">
<i class="fa fa-whatsapp"></i>
<p>Email</p>
</a>
</li>
{{ end }}
<!-- Email -->
{{ if .Site.Params.socialshare.email }}
<li>
<a href="mailto:?subject={{ .Site.Title }} - {{ $title }}.&amp;body={{ $body }}" target="_blank" class="share-btn email">
<i class="fa fa-envelope"></i>
<p>Email</p>
</a>
</li>
</ul>
</div>
{{ end }}