Theme Files Update
This commit is contained in:
parent
bbc0089b64
commit
dbfec60fde
2 changed files with 4 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
async function linkShare(t, u, s){
|
async function linkShare(t, u, s){
|
||||||
let data = {title: t,text: s,url: u};
|
let shd = {title: t,text: s,url: u};
|
||||||
if(navigator.canShare(data)){
|
if(navigator.canShare(shd)){
|
||||||
try {await navigator.share(data);} catch (er) {console.error(er);}
|
try {await navigator.share(shd);} catch (er) {console.error(er);}
|
||||||
}else if (navigator?.clipboard?.writeText){
|
}else if (navigator?.clipboard?.writeText){
|
||||||
try {await navigator.clipboard.writeText(u);} catch (err) {console.error(err);}
|
try {await navigator.clipboard.writeText(u);} catch (err) {console.error(err);}
|
||||||
}else{console.log("Neither WebShare API nor CLipboard API is supported")}}
|
}else{console.log("Neither WebShare API nor CLipboard API is supported")}}
|
|
@ -38,8 +38,7 @@
|
||||||
<script async src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
<script async src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- if and (not (eq .Site.Params.shareSocial nil)) (.Site.Params.shareSocial) -}}
|
{{- if and (not (eq .Site.Params.shareSocial nil)) (.Site.Params.shareSocial) -}}
|
||||||
{{ $linkShareJS := resources.Get "js/link-share.js" -}}
|
{{ $linkshare := resources.Get "js/link-share.js" | fingerprint -}}
|
||||||
{{ $linkshare := $linkShareJS | minify | fingerprint -}}
|
|
||||||
<script async src="{{ $linkshare.Permalink }}" {{ printf "integrity=%q" $linkshare.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
<script async src="{{ $linkshare.Permalink }}" {{ printf "integrity=%q" $linkshare.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ range .Params.custom_js -}}<script type="text/javascript" src="{{ . | absURL }}"></script>{{- end }}
|
{{ range .Params.custom_js -}}<script type="text/javascript" src="{{ . | absURL }}"></script>{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue