diff options
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/head.html | 10 | ||||
-rw-r--r-- | layouts/partials/scripts.html | 12 |
2 files changed, 14 insertions, 8 deletions
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" }} -<script - src="https://code.jquery.com/jquery-3.3.1.min.js" - integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" - crossorigin="anonymous"></script> -<script - src="https://d3js.org/d3.v4.min.js" - integrity="sha384-1EOYqz4UgZkewWm70NbT1JBUXSQpOIS2AaJy6/evZH+lXOrt9ITSJbFctNeyBoIJ" - crossorigin="anonymous"></script> +<script src="/js/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> +<script src="/js/d3.v4.min.js" integrity="sha384-1EOYqz4UgZkewWm70NbT1JBUXSQpOIS2AaJy6/evZH+lXOrt9ITSJbFctNeyBoIJ" crossorigin="anonymous"></script> {{ 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 @@ +<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" . }} |