aboutsummaryrefslogtreecommitdiff
path: root/site/layouts/_default/examples.html
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2024-03-08 12:53:43 +0200
committerXhmikosR <[email protected]>2024-03-19 11:25:15 +0200
commit45fe28c5a6ed88d1a661355349aed799a79ed0fe (patch)
tree1979bc74bb86022d75c6b0aea04e246c83c8856d /site/layouts/_default/examples.html
parent6922f5d9cb1e903877532f23214a4378aeaad909 (diff)
downloadbootstrap-45fe28c5a6ed88d1a661355349aed799a79ed0fe.tar.xz
bootstrap-45fe28c5a6ed88d1a661355349aed799a79ed0fe.zip
docs: use defer when possible for JS
Diffstat (limited to 'site/layouts/_default/examples.html')
-rw-r--r--site/layouts/_default/examples.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/site/layouts/_default/examples.html b/site/layouts/_default/examples.html
index 3b048a9d4..c252ea46e 100644
--- a/site/layouts/_default/examples.html
+++ b/site/layouts/_default/examples.html
@@ -159,13 +159,13 @@
{{ .Content }}
{{- if hugo.IsProduction -}}
- <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" {{ printf "integrity=%q" .Site.Params.cdn.js_bundle_hash | safeHTMLAttr }}></script>
+ <script defer src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" {{ printf "integrity=%q" .Site.Params.cdn.js_bundle_hash | safeHTMLAttr }}></script>
{{- else -}}
- <script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
+ <script defer src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
{{- end }}
{{ range .Page.Params.extra_js -}}
- <script{{ with .async }} async{{ end }} src="{{ .src }}"{{ with .integrity }} {{ printf "integrity=%q" . | safeHTMLAttr }} crossorigin="anonymous"{{ end }}></script>
+ <script{{ with .async }} async{{ end }}{{ with .defer }} defer{{ end }} src="{{ .src }}"{{ with .integrity }} {{ printf "integrity=%q" . | safeHTMLAttr }} crossorigin="anonymous"{{ end }}></script>
{{- end -}}
</body>
</html>