diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 3a29eb045..af4a25abc 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -72,7 +72,7 @@ {{- end -}} {{- /* Sharer.js */ -}} -{{- if $params.share.enable -}} +{{- if $params.share.enable | and (.Scratch.Get "this").sharer -}} {{- $source := $cdn.sharerJS | default "lib/sharer/sharer.min.js" -}} {{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- $config = dict "sharerjs" true | merge $config -}} diff --git a/layouts/partials/plugin/share.html b/layouts/partials/plugin/share.html index 92f3a2af5..245a70309 100644 --- a/layouts/partials/plugin/share.html +++ b/layouts/partials/plugin/share.html @@ -1,5 +1,5 @@ {{- $share := (.Scratch.Get "params").share | default dict -}} - +{{- .Page.Scratch.SetInMap "this" "sharer" true -}} {{- if $share.enable -}} {{- /* 001: Twitter */ -}} {{- if $share.Twitter -}}