Skip to content

Commit

Permalink
Scripts: get Popper from Bootstrap bundle (#1268)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Oct 8, 2022
1 parent 0204dd9 commit 0e79123
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
{{ printf "onload='renderMathInElement(%s, %s);'" (( .Site.Params.katex.html_dom_element | default "document.body" ) | safeJS ) ( printf "%s" ( $.Site.Params.katex.options | jsonify )) | safeHTMLAttr }}></script>
{{ end -}}

{{ $jsPopper := resources.GetRemote "https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.js" -}}
{{ $jsBs := resources.Get "vendor/bootstrap/dist/js/bootstrap.js" -}}
{{ $jsBs := resources.Get "vendor/bootstrap/dist/js/bootstrap.bundle.js" -}}
{{ $jsBase := resources.Get "js/base.js" -}}
{{ $jsAnchor := resources.Get "js/anchor.js" -}}
{{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home -}}
Expand All @@ -60,7 +59,7 @@
{{ if .Site.Params.offlineSearch -}}
{{ $jsSearch = resources.Get "js/offline-search.js" -}}
{{ end -}}
{{ $js := (slice $jsPopper $jsBs $jsBase $jsAnchor $jsSearch $jsMermaid $jsPlantuml $jsMarkmap $jsDrawio) | resources.Concat "js/main.js" -}}
{{ $js := (slice $jsBs $jsBase $jsAnchor $jsSearch $jsMermaid $jsPlantuml $jsMarkmap $jsDrawio) | resources.Concat "js/main.js" -}}
{{ if hugo.IsProduction -}}
{{ $js := $js | minify | fingerprint -}}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
Expand Down

0 comments on commit 0e79123

Please sign in to comment.