summaryrefslogtreecommitdiffhomepage
path: root/layouts/partials/scripts.html
diff options
context:
space:
mode:
authorIan Lewis <ianmlewis@gmail.com>2019-05-30 04:20:12 -0400
committerIan Lewis <ianlewis@google.com>2019-05-31 08:15:32 +0900
commitd480bf388918944d322a499f3dbbd51f7e977b82 (patch)
tree8feea97a105b6a2e3a834f0285f7ead1fde98696 /layouts/partials/scripts.html
parentb532e65552a6035a827b5df28aaaee4d003c420e (diff)
Serve all javascript from gvisor.dev
For security & privacy reasons, serve javascript from gvisor.dev instead of using external CDNs.
Diffstat (limited to 'layouts/partials/scripts.html')
-rw-r--r--layouts/partials/scripts.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
new file mode 100644
index 000000000..b6f9696d3
--- /dev/null
+++ b/layouts/partials/scripts.html
@@ -0,0 +1,12 @@
+<script src="/js/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
+<script src="/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
+{{ $jsBase := resources.Get "js/base.js" }}
+{{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home }}
+{{ $js := (slice $jsBase $jsSearch) | resources.Concat "js/main.js" }}
+{{ if .Site.IsServer }}
+<script src="{{ $js.RelPermalink }}"></script>
+{{ else }}
+{{ $js := $js | minify | fingerprint }}
+<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
+{{ end }}
+{{ partial "hooks/body-end.html" . }}