aboutsummaryrefslogtreecommitdiff
path: root/layouts/_default/baseof.html
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default/baseof.html')
-rw-r--r--layouts/_default/baseof.html13
1 files changed, 11 insertions, 2 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index cdb9a1f..6d312b6 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -30,8 +30,17 @@
{{ block "header" . -}}{{ end -}}
{{ block "main" . -}}{{ end -}}
{{ block "footer" . -}}{{ end }}
- {{ $script := resources.Get "js/main.js" | minify | fingerprint -}}
- <script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
+
+ {{ $main := resources.Get "js/main.js" -}}
+ {{ if .Site.Params.code_copy_button | default true -}}
+ {{ $codeCopy := resources.Get "js/code-copy.js" -}}
+ {{ $script := slice $main $codeCopy | resources.Concat "js/bundle.js" | minify | fingerprint -}}
+ <script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
+ {{ else -}}
+ {{ $script := $main | minify | fingerprint -}}
+ <script src="{{ $script.Permalink }}" {{ printf "integrity=%q" $script.Data.Integrity | safeHTMLAttr }} crossorigin="anonymous"></script>
+ {{ end }}
+
{{- partial "analytics.html" . }}
{{- if templates.Exists "partials/extra-foot.html" -}}
{{ partial "extra-foot.html" . }}