mirror of
https://github.com/twbs/bootstrap.git
synced 2024-11-29 11:24:18 +01:00
6637154beb
* Revert "Adapt to the recent main changes" This reverts commit50d8921670
. * Revert "Add Hugo Pipes logic for local and vendored scripts." This reverts commit3fcfd606f2
. * Revert "Use Hugo mounts for our docs vendor JS files." This reverts commit6b071116f3
.
21 lines
913 B
HTML
21 lines
913 B
HTML
{{ if eq hugo.Environment "production" -}}
|
|
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" {{ printf "integrity=%q" .Site.Params.cdn.js_bundle_hash | safeHTMLAttr }} crossorigin="anonymous"></script>
|
|
{{ else -}}
|
|
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
|
|
{{- end }}
|
|
|
|
{{ if eq .Page.Layout "docs" -}}
|
|
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
|
|
{{- end }}
|
|
|
|
{{- $vendor := resources.Match "js/vendor/*.js" -}}
|
|
{{- $js := resources.Match "js/*.js" -}}
|
|
{{- $targetDocsJSPath := printf "/docs/%s/assets/js/docs.js" .Site.Params.docs_version -}}
|
|
{{- $docsJs := append $js $vendor | resources.Concat $targetDocsJSPath -}}
|
|
|
|
{{- if eq hugo.Environment "production" -}}
|
|
{{- $docsJs = $docsJs | resources.Minify -}}
|
|
{{- end }}
|
|
|
|
<script src="{{ $docsJs.Permalink | relURL }}"></script>
|