bobatheme/layouts/partials/share.html

70 lines
2.5 KiB
HTML
Raw Normal View History

2022-04-30 21:23:45 -05:00
<div class="share-buttons">
{{ if .Site.Params.shareButtons.twitter }}
<a class="twitter-share"
target="_blank"
rel="noopener"
2023-01-26 16:36:03 -06:00
aria-label="{{ i18n "aria_share_twitter" }}"
2022-05-01 18:14:02 -05:00
onclick="share_event('Twitter');"
2022-04-30 21:23:45 -05:00
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
{{- partial "icon.html" "twitter" -}}
</a>
{{ end }}
{{ if .Site.Params.shareButtons.facebook }}
<a class="facebook-share"
target="_blank"
rel="noopener"
2023-01-26 16:36:03 -06:00
aria-label="{{ i18n "aria_share_facebook" }}"
2022-05-01 18:14:02 -05:00
onclick="share_event('Facebook');"
2022-04-30 21:23:45 -05:00
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
{{- partial "icon.html" "facebook" -}}
</a>
{{ end }}
{{ if .Site.Params.shareButtons.linkedin }}
<a class="linkedin-share"
target="_blank"
rel="noopener"
2023-01-26 16:36:03 -06:00
aria-label="{{ i18n "aria_share_linkedin" }}"
2022-05-01 18:14:02 -05:00
onclick="share_event('LinkedIn');"
2022-04-30 21:23:45 -05:00
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
{{- partial "icon.html" "linkedin" -}}
</a>
{{ end }}
{{ if .Site.Params.shareButtons.reddit }}
<a class="reddit-share"
target="_blank"
rel="noopener"
2023-01-26 16:36:03 -06:00
aria-label="{{ i18n "aria_share_reddit" }}"
2022-05-01 18:14:02 -05:00
onclick="share_event('Reddit');"
2022-04-30 21:23:45 -05:00
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
{{- partial "icon.html" "reddit" -}}
</a>
{{ end }}
{{/* Telegram icon doesn't have `viewbox` set, which breaks the sizing.
https://stackoverflow.com/q/72073399/19003757
https://github.com/michaelampr/jam/issues/39
{{ if .Site.Params.shareButtons.telegram }}
<a class="telegram-share"
target="_blank"
rel="noopener"
2023-01-26 16:36:03 -06:00
aria-label="{{ i18n "aria_share_telegram" }}"
2022-05-01 18:14:02 -05:00
onclick="share_event('Telegram');"
2022-04-30 21:23:45 -05:00
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
{{- partial "icon.html" "telegram" -}}
</a>
{{ end }}
*/}}
2022-05-08 15:21:41 -05:00
{{ if .Site.Params.shareButtons.print }}
<a class="print-share"
2023-01-26 16:36:03 -06:00
aria-label="{{ i18n "aria_share_print" }}"
href="javascript:void(0)"
2022-05-08 15:21:41 -05:00
onclick="window.print(); share_event('Print');">
{{- partial "icon.html" "printer" -}}
</a>
2022-05-08 15:21:41 -05:00
{{ end }}
2022-04-30 21:23:45 -05:00
</div>