Moving scripts to partial. Adding cache buser to script file. Generate cache buster from /public and not /theme since theme path is not known.
This commit is contained in:
parent
2074a3a530
commit
fbae824150
3 changed files with 7 additions and 6 deletions
|
|
@ -1,8 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.Language.Lang }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
<link rel="stylesheet" href="/css/styles.css?{{ readFile "/themes/zen/static/css/styles.css" | sha1}}">
|
||||
{{ partial "meta.html" . }}
|
||||
{{ block "meta" . }}{{ end }}
|
||||
</head>
|
||||
|
|
@ -27,8 +27,6 @@
|
|||
{{ if .Site.Params.poweredby }}<p>Powered by <a href="https://gohugo.io/">Hugo</a></p>{{ end }}
|
||||
</footer>
|
||||
</div>
|
||||
{{ 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"></script>{{ end }}
|
||||
{{ partial "scripts.html" . }}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<meta charset="utf-8">
|
||||
<link rel="shortcut icon" href="{{ .Site.BaseURL }}favicon.ico" type="image/vnd.microsoft.icon">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes">
|
||||
<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="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">
|
||||
{{ with .RSSLink }}<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ . }}">{{ end }}
|
||||
{{ with .Site.Params.contact }}<meta name="contact" content="{{ . }}">{{ end }}
|
||||
|
|
|
|||
3
layouts/partials/scripts.html
Normal file
3
layouts/partials/scripts.html
Normal file
|
|
@ -0,0 +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 }}
|
||||
Loading…
Reference in a new issue