Skip to content

Commit 89bc68f

Browse files
committed
another attempt at fix
1 parent ffcb97a commit 89bc68f

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

themes/devopsdays-theme/layouts/partials/footer_scripts.html

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,16 @@
9090
{{- if not $shares_js_str -}}
9191
{{- $shares_js_str = "\"email\", {share: \"twitter\", via: 'devopsdays'}, \"facebook\", \"linkedin\"" -}}
9292
{{- end -}}
93-
{{- $.Scratch.Set "shares_js" $shares_js_str -}}
93+
{{- $sharing_title_final := $.Scratch.Get "sharing_title" -}}
94+
{{- if not $sharing_title_final -}}
95+
{{- $sharing_title_final = "devopsdays" -}}
96+
{{- end -}}
97+
{{- $full_script := printf "$(document).ready(function () {\n //YOUR JQUERY CODE\n\n $(\"#share\").jsSocials({\n shares: [%s],\n text: '%s',\n showLabel: false,\n showCount: false\n });\n});" $shares_js_str $sharing_title_final -}}
9498

9599
<script>
96100
//shares
97101

98102

99-
$(document).ready(function () {
100-
//YOUR JQUERY CODE
101-
{{- $shares_js_final := $.Scratch.Get "shares_js" -}}
102-
{{- if not $shares_js_final -}}
103-
{{- $shares_js_final = "\"email\", {share: \"twitter\", via: 'devopsdays'}, \"facebook\", \"linkedin\"" -}}
104-
{{- end -}}
105-
$("#share").jsSocials({
106-
shares: [{{ $shares_js_final }}],
107-
text: '{{ ($.Scratch.Get "sharing_title") }}',
108-
showLabel: false,
109-
showCount: false
110-
});
111-
});
103+
{{ $full_script | safeJS }}
112104

113105
</script>

0 commit comments

Comments
 (0)