]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Simplify code.
authorXhmikosR <xhmikosr@gmail.com>
Fri, 19 Jul 2019 15:49:52 +0000 (18:49 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Mon, 22 Jul 2019 13:08:58 +0000 (16:08 +0300)
site/layouts/_default/examples.html

index 827292d6dec87dde17784332d9f458ec3899500e..ee3a5d42e816d563d57b3d6424adb11b756612d1 100644 (file)
   <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>