mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-28 00:54:30 +01:00
Simplify code.
This commit is contained in:
parent
967f1ab37a
commit
4ba4cc2e79
@ -42,18 +42,16 @@
|
|||||||
<body{{ with .Page.Params.body_class }} class="{{ . }}"{{ end }}>
|
<body{{ with .Page.Params.body_class }} class="{{ . }}"{{ end }}>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
|
|
||||||
{{ if ne .Page.Params.include_js false }}
|
{{ if ne .Page.Params.include_js false -}}
|
||||||
{{ if eq (getenv "HUGO_ENV") "production" }}
|
{{- 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>
|
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.min.js" integrity="{{ .Site.Params.cdn.js_bundle_hash }}" crossorigin="anonymous"></script>
|
||||||
{{ else }}
|
{{- else -}}
|
||||||
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
|
<script src="/docs/{{ .Site.Params.docs_version }}/dist/js/bootstrap.bundle.js"></script>
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{ range .Page.Params.extra_js }}
|
|
||||||
{{ $integrity := .integrity }}
|
|
||||||
{{ $async := .async }}
|
|
||||||
<script src="{{ .src }}"{{ with $integrity }} integrity="{{ $integrity }}"{{ end }}{{ with $async }} async{{ end }} crossorigin="anonymous"></script>
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ end }}
|
|
||||||
|
{{ range .Page.Params.extra_js -}}
|
||||||
|
<script{{ with .async }} async{{ end }} src="{{ .src }}"{{ with .integrity }} integrity="{{ . }}"{{ end }} crossorigin="anonymous"></script>
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user