mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-12 00:08:59 +01:00
129bb08fc4
Now there's only one command needed to run the docs: `npm run docs-serve`. Also, simplify the npm scripts.
21 lines
934 B
HTML
21 lines
934 B
HTML
{{ if eq (getenv "HUGO_ENV") "production" -}}
|
|
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ .Site.Params.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
|
|
{{ else -}}
|
|
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
|
|
{{- end }}
|
|
|
|
{{ if (or (eq .Page.Layout "docs") (eq .Page.Layout "single")) -}}
|
|
<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/src/*.js" -}}
|
|
{{- $targetDocsJSPath := printf "/docs/%s/assets/js/docs.js" .Site.Params.docs_version -}}
|
|
{{- $docsJs := append $js $vendor | resources.Concat $targetDocsJSPath -}}
|
|
|
|
{{- if (eq (getenv "HUGO_ENV") "production") -}}
|
|
{{- $docsJs = $docsJs | resources.Minify -}}
|
|
{{- end }}
|
|
|
|
<script src="{{ $docsJs.Permalink | relURL }}"></script>
|