add sub resource integrity (SRI) to processed assets

- search javascript
- SCSS processed stylesheet
This commit is contained in:
Paul Twohey 2019-09-01 19:55:41 -07:00 committed by Alex Shpak
parent 964968be39
commit 64dfdf39fb

View file

@ -4,11 +4,11 @@
<!-- Theme stylesheet, you can customize scss by creating `assets/custom.scss` in your website -->
{{- $styles := resources.Get "book.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}">
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
{{ if default true .Site.Params.BookSearch }}
{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate "search.js" . | resources.Minify | resources.Fingerprint }}
<script defer src="{{ $searchJS.RelPermalink }}"></script>
<script defer src="{{ $searchJS.RelPermalink }}" integrity="{{ $searchJS.Data.Integrity }}"></script>
{{ end }}
<!-- Favicon -->