diff options
| author | XhmikosR <[email protected]> | 2019-07-19 18:49:52 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-07-22 16:08:58 +0300 |
| commit | 4ba4cc2e795b7c7219aa92568bafb0419fba4711 (patch) | |
| tree | 02673a3eceb9df66329e5d37c4bd2a4a7fdd5998 | |
| parent | 967f1ab37a46c937b31a3fe76805597be0a69432 (diff) | |
| download | bootstrap-4ba4cc2e795b7c7219aa92568bafb0419fba4711.tar.xz bootstrap-4ba4cc2e795b7c7219aa92568bafb0419fba4711.zip | |
Simplify code.
| -rw-r--r-- | site/layouts/_default/examples.html | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/site/layouts/_default/examples.html b/site/layouts/_default/examples.html index 827292d6d..ee3a5d42e 100644 --- a/site/layouts/_default/examples.html +++ b/site/layouts/_default/examples.html @@ -42,18 +42,16 @@ <body{{ with .Page.Params.body_class }} class="{{ . }}"{{ end }}> {{ .Content }} - {{ if ne .Page.Params.include_js false }} - {{ if eq (getenv "HUGO_ENV") "production" }} + {{ if ne .Page.Params.include_js false -}} + {{- 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 }} + {{- else -}} <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 }} + + {{ range .Page.Params.extra_js -}} + <script{{ with .async }} async{{ end }} src="{{ .src }}"{{ with .integrity }} integrity="{{ . }}"{{ end }} crossorigin="anonymous"></script> + {{- end -}} + {{- end }} </body> </html> |
