mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 12:13:19 -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" }}
|
{{ with resources.Get "css/syntax-light.css" | fingerprint "sha512" }}
|
||||||
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ with resources.Get "js/back-to-top.js" | fingerprint "sha512" }}
|
{{ with resources.Get "js/back-to-top.js" | fingerprint "sha512" }}
|
||||||
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
<script defer src="{{ .Permalink }}" type="text/javascript" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"></script>
|
||||||
{{ end }}
|
{{ 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 }}
|
{{ with .Site.Params.faviconSVG }}
|
||||||
<link rel="icon" href="{{ . | absURL }}" />
|
<link rel="icon" href="{{ . | absURL }}" />
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
<a class="twitter-share"
|
<a class="twitter-share"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
|
onclick="share_event('Twitter');"
|
||||||
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
|
href="https://twitter.com/intent/tweet?url={{ .Permalink }}&text={{ .Title }}&via=bbaovanc">
|
||||||
{{- partial "icon.html" "twitter" -}}
|
{{- partial "icon.html" "twitter" -}}
|
||||||
</a>
|
</a>
|
||||||
@ -12,6 +13,7 @@
|
|||||||
<a class="facebook-share"
|
<a class="facebook-share"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
|
onclick="share_event('Facebook');"
|
||||||
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
|
href="https://www.facebook.com/sharer.php?u={{ .Permalink }}">
|
||||||
{{- partial "icon.html" "facebook" -}}
|
{{- partial "icon.html" "facebook" -}}
|
||||||
</a>
|
</a>
|
||||||
@ -21,6 +23,7 @@
|
|||||||
<a class="linkedin-share"
|
<a class="linkedin-share"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
|
onclick="share_event('LinkedIn');"
|
||||||
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
|
href="https://www.linkedin.com/sharing/share-offsite/?url={{ .Permalink }}">
|
||||||
{{- partial "icon.html" "linkedin" -}}
|
{{- partial "icon.html" "linkedin" -}}
|
||||||
</a>
|
</a>
|
||||||
@ -30,6 +33,7 @@
|
|||||||
<a class="reddit-share"
|
<a class="reddit-share"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
|
onclick="share_event('Reddit');"
|
||||||
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
|
href="https://reddit.com/submit?url={{ .Permalink }}&title={{ .Title }}">
|
||||||
{{- partial "icon.html" "reddit" -}}
|
{{- partial "icon.html" "reddit" -}}
|
||||||
</a>
|
</a>
|
||||||
@ -42,6 +46,7 @@
|
|||||||
<a class="telegram-share"
|
<a class="telegram-share"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener"
|
rel="noopener"
|
||||||
|
onclick="share_event('Telegram');"
|
||||||
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
|
href="https://t.me/share/url?url={{ .Permalink }}&text={{ .Title }}">
|
||||||
{{- partial "icon.html" "telegram" -}}
|
{{- partial "icon.html" "telegram" -}}
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user