Theme Files Update

This commit is contained in:
GitHub Action 2023-11-06 08:46:57 +00:00
parent dbfec60fde
commit 9be4cc1b9b
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
async function linkShare(t, u, s){
let shd = {title: t,text: s,url: u};
if(navigator.canShare(shd)){
if(typeof navigator.canShare === "function" && navigator.canShare(shd)){
try {await navigator.share(shd);} catch (er) {console.error(er);}
}else if (navigator?.clipboard?.writeText){
try {await navigator.clipboard.writeText(u);} catch (err) {console.error(err);}

View file

@ -38,7 +38,7 @@
<script async src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{- end -}}
{{- if and (not (eq .Site.Params.shareSocial nil)) (.Site.Params.shareSocial) -}}
{{ $linkshare := resources.Get "js/link-share.js" | fingerprint -}}
{{ $linkshare := resources.Get "js/link-share.js" | minify | fingerprint -}}
<script async src="{{ $linkshare.Permalink }}" {{ printf "integrity=%q" $linkshare.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
{{- end -}}
{{ range .Params.custom_js -}}<script type="text/javascript" src="{{ . | absURL }}"></script>{{- end }}