Make cache bust hashes optional.
This commit is contained in:
parent
fbae824150
commit
0d35371f5f
3 changed files with 4 additions and 2 deletions
|
|
@ -58,6 +58,8 @@ params:
|
|||
slicknav: true # Activates SlickNav, a nice mobile menu.
|
||||
search: true # Site search with DuckDuckGo.
|
||||
searchSize: 20 # Search field size, default 20.
|
||||
cacheBustCSS: true # Add a cache busting hash on styles.css
|
||||
cacheBustJS: true # Add a cache busting hash on script.js
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<meta name="MobileOptimized" content="width">
|
||||
<meta name="HandheldFriendly" content="true">
|
||||
{{ .Hugo.Generator }}
|
||||
<link rel="stylesheet" href="/css/styles.css?{{ readFile "/public/css/styles.css" | sha1}}">
|
||||
<link rel="stylesheet" href="/css/styles.css{{ if .Site.Params.cacheBustCSS }}?{{ readFile "/public/css/styles.css" | sha1 }}{{ end }}">
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<link rel="shortcut icon" href="{{ .Site.BaseURL }}favicon.ico" type="image/vnd.microsoft.icon">
|
||||
<link rel="apple-touch-icon" href="{{ .Site.BaseURL }}apple-touch-icon.png">
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
{{ if .Site.Params.jquery }}<script src="/js/jquery.min.js"></script>{{ end }}
|
||||
{{ if and .Site.Params.jquery .Site.Params.slicknav }}<script src="/js/jquery.slicknav.min.js"></script>{{ end }}
|
||||
{{ if .Site.Params.jquery }}<script src="/js/script.js?{{ readFile "/public/js/script.js" | sha1}}"></script>{{ end }}
|
||||
{{ if .Site.Params.jquery }}<script src="/js/script.js{{ if .Site.Params.cacheBustJS }}?{{ readFile "/public/js/script.js" | sha1 }}{{ end }}"></script>{{ end }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue