]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Allow to pass integrity & async attribute to extra js
authorMartijn Cuppens <martijn.cuppens@gmail.com>
Sun, 30 Jun 2019 13:24:24 +0000 (15:24 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Mon, 22 Jul 2019 13:08:58 +0000 (16:08 +0300)
site/content/docs/4.3/examples/checkout/index.html
site/content/docs/4.3/examples/dashboard/index.html
site/content/docs/4.3/examples/offcanvas/index.html
site/layouts/_default/examples.html

index 353111883f37a73ca46b1b708f3220e26d9c9169..ac67d8a6e8d631e531e6a1f03ecc1622f0014bd4 100644 (file)
@@ -4,7 +4,7 @@ title: Checkout example
 extra_css:
   - "form-validation.css"
 extra_js:
-  - "form-validation.js"
+  - src: "form-validation.js"
 body_class: "bg-light"
 ---
 
index f44d6b326de4e7528a7729bcc3ebb372fc089522..6e7953cdfbfd67208c5f4f83638e24f68f28b3f1 100644 (file)
@@ -4,9 +4,11 @@ title: Dashboard Template
 extra_css:
   - "dashboard.css"
 extra_js:
-  - "https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.9.0/feather.min.js"
-  - "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"
-  - "dashboard.js"
+  - src: "https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.22.1/feather.min.js"
+    integrity: "sha256-v7ozvh+7DfgbxrO6V1UgXsR+DDFHZr5ESbMWn6J5c8s="
+  - src: "https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js"
+    integrity: "sha256-Uv9BNBucvCPipKQ2NS9wYpJmi8DTOEfTA/nH2aoJALw="
+  - src: "dashboard.js"
 ---
 
 <nav class="navbar navbar-dark fixed-top bg-dark flex-md-nowrap p-0 shadow">
index 0e529d819469649933875d44eb4ff87a6c879873..85a5cf4f797d45666b5258fe471c277daeec53c8 100644 (file)
@@ -4,7 +4,7 @@ title: Offcanvas template
 extra_css:
   - "offcanvas.css"
 extra_js:
-  - "offcanvas.js"
+  - src: "offcanvas.js"
 body_class: "bg-light"
 ---
 
index d6050625d6e6aa01f48cbf478bb1fd77b3c647cb..827292d6dec87dde17784332d9f458ec3899500e 100644 (file)
@@ -50,7 +50,9 @@
       {{ end }}
 
       {{ range .Page.Params.extra_js }}
-        <script src="{{ . }}"></script>
+        {{ $integrity := .integrity }}
+        {{ $async := .async }}
+        <script src="{{ .src }}"{{ with $integrity }} integrity="{{ $integrity }}"{{ end }}{{ with $async }} async{{ end }} crossorigin="anonymous"></script>
       {{- end }}
     {{ end }}
   </body>