mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 04:13:17 -06:00
Add share_event JS function
This commit is contained in:
parent
a172b1ea21
commit
fa5c014a1b
3
assets/js/share-event.js
Normal file
3
assets/js/share-event.js
Normal file
@ -0,0 +1,3 @@
|
||||
function share_event(service) {
|
||||
// this function does nothing by default
|
||||
}
|
@ -12,9 +12,13 @@
|
||||
{{ with resources.Get "css/syntax-light.css" | fingerprint "sha512" }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end }}
|
||||
|
||||
{{ with resources.Get "js/back-to-top.js" | fingerprint "sha512" }}
|
||||
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{ end }}
|
||||
{{ with resources.Get "js/share-event.js" | fingerprint "sha512" }}
|
||||
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.faviconSVG }}
|
||||
<link rel="icon" href="{{ . | absURL }}" />
|
||||
|
@ -3,6 +3,7 @@
|
||||
<a class="twitter-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('Twitter');"
|
||||
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
|
||||
{{- partial "icon.html" "twitter" -}}
|
||||
</a>
|
||||
@ -12,6 +13,7 @@
|
||||
<a class="facebook-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('Facebook');"
|
||||
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
|
||||
{{- partial "icon.html" "facebook" -}}
|
||||
</a>
|
||||
@ -21,6 +23,7 @@
|
||||
<a class="linkedin-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('LinkedIn');"
|
||||
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
|
||||
{{- partial "icon.html" "linkedin" -}}
|
||||
</a>
|
||||
@ -30,6 +33,7 @@
|
||||
<a class="reddit-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('Reddit');"
|
||||
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
|
||||
{{- partial "icon.html" "reddit" -}}
|
||||
</a>
|
||||
@ -42,6 +46,7 @@
|
||||
<a class="telegram-share"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
onclick="share_event('Telegram');"
|
||||
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
|
||||
{{- partial "icon.html" "telegram" -}}
|
||||
</a>
|
||||
|
Loading…
Reference in New Issue
Block a user