Skip to content

Commit

Permalink
defer
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 19, 2024
1 parent 2f4af84 commit cc2468d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{- end -}}

{{- $bootstrapJs := resources.Get "/js/vendor/bootstrap.bundle.min.js" | fingerprint | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" -}}
<script async src="{{ $bootstrapJs.RelPermalink }}"></script>
<script defer src="{{ $bootstrapJs.RelPermalink }}"></script>

{{- $application := resources.Get "js/application.js" | js.Build $esbuildOptions | fingerprint -}}
{{- $lazyload := resources.Get "js/lazyload.js" | js.Build $esbuildOptions | fingerprint -}}
Expand All @@ -18,8 +18,8 @@
{{- $application = $application | resources.Copy "/assets/js/application.js" -}}
{{- $lazyload = $lazyload | resources.Copy "/assets/js/lazyload.js" -}}

<script async src="{{ $application.RelPermalink }}"></script>
<script async src="{{ $lazyload.RelPermalink }}"></script>
<script defer src="{{ $application.RelPermalink }}"></script>
<script defer src="{{ $lazyload.RelPermalink }}"></script>

{{ range .Page.Params.extra_js -}}
<script{{ with .async }} async{{ end }}{{ with .defer }} defer{{ end }} src="{{ .src }}"{{ with .integrity }} {{ printf "integrity=%q" . | safeHTMLAttr }} crossorigin="anonymous"{{ end }}></script>
Expand Down

0 comments on commit cc2468d

Please sign in to comment.