mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-18 16:42:21 +01:00
layouts/_default/baseof.html: Allow disabling of SRI
Some sites using edge caching like that on a CDN or S3 might have issues with assets being cached too long, causing user agents to refuse to load assets due to SRI hash mismatch. These sites should disable the use of sub-resource integrity hashes using this config option in their config: disable_sri = true
This commit is contained in:
parent
dc0201301b
commit
a81ed6803b
@ -13,7 +13,7 @@
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
{{ "<!-- combined, minified CSS -->" | safeHTML }}
|
||||
<link href="{{ .Site.BaseURL }}css/style.css" rel="stylesheet" integrity="{{ .Site.Data.sri.style}}" crossorigin="anonymous">
|
||||
<link href="{{ .Site.BaseURL }}css/style.css" rel="stylesheet"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.style}}" crossorigin="anonymous"{{ end }}>
|
||||
|
||||
{{ if .RSSLink }}
|
||||
{{ "<!-- RSS 2.0 feed -->" | safeHTML }}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<link href="{{ .Site.BaseURL }}css/cookieconsent.min.css" rel="stylesheet" type="text/css" integrity="{{ .Site.Data.sri.cookieconsentcss }}" crossorigin="anonymous">
|
||||
<script src="{{ .Site.BaseURL }}js/cookieconsent.min.js" integrity="{{ .Site.Data.sri.cookieconsentjs }}" crossorigin="anonymous" async></script>
|
||||
<link href="{{ .Site.BaseURL }}css/cookieconsent.min.css" rel="stylesheet" type="text/css"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.cookieconsentcss }}" crossorigin="anonymous"{{ end }}>
|
||||
<script src="{{ .Site.BaseURL }}js/cookieconsent.min.js"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.cookieconsentjs }}" crossorigin="anonymous"{{ end }} async></script>
|
||||
|
||||
<script>
|
||||
window.addEventListener("load", function(){
|
||||
|
Loading…
Reference in New Issue
Block a user