From d480bf388918944d322a499f3dbbd51f7e977b82 Mon Sep 17 00:00:00 2001 From: Ian Lewis Date: Thu, 30 May 2019 04:20:12 -0400 Subject: Serve all javascript from gvisor.dev For security & privacy reasons, serve javascript from gvisor.dev instead of using external CDNs. --- layouts/partials/head.html | 10 ++-------- layouts/partials/scripts.html | 12 ++++++++++++ 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 layouts/partials/scripts.html (limited to 'layouts') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 47c205a2f..1587dbddc 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -20,12 +20,6 @@ {{ template "_internal/google_analytics_async.html" . }} {{ end }} {{ partialCached "head-css.html" . "asdf" }} - - + + {{ partial "hooks/head-end.html" . }} 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 @@ + + +{{ $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 }} + +{{ else }} +{{ $js := $js | minify | fingerprint }} + +{{ end }} +{{ partial "hooks/body-end.html" . }} -- cgit v1.2.3