Move meta and script tags that need cached to *_cached partials.
This commit is contained in:
parent
94493554ca
commit
2bcf1168c8
6 changed files with 9 additions and 6 deletions
|
|
@ -4,8 +4,8 @@
|
|||
<meta charset="utf-8">
|
||||
<title>{{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }}</title>
|
||||
{{ block "meta" . }}{{ end }}
|
||||
{{- partialCached "meta.html" . -}}
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
{{- partial "meta.html" . -}}
|
||||
{{- partialCached "meta_cache.html" . -}}
|
||||
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID }}{{ partialCached "piwik.html" . }}{{ end -}}
|
||||
</head>
|
||||
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a></p>{{ end -}}
|
||||
</footer>
|
||||
</div>
|
||||
{{ partialCached "scripts.html" . }}
|
||||
{{ partial "scripts.html" . -}}
|
||||
{{ partialCached "scripts_cache.html" . -}}
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
{{ define "title" }}{{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "meta" }}
|
||||
{{ partial "single_meta.html" . -}}
|
||||
{{- partial "section_meta.html" . -}}
|
||||
{{- partial "single_meta.html" . -}}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" -}}
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
<meta name="HandheldFriendly" content="true">
|
||||
{{ .Hugo.Generator }}
|
||||
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }}
|
||||
<link rel="stylesheet" href="/css/styles.css{{ if $.Param "cacheBustCSS" }}?{{ readFile "/public/css/styles.css" | sha1 }}{{ end }}">
|
||||
<link rel="canonical" href="{{ .Permalink }}">
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
|
|
|
|||
1
layouts/partials/meta_cache.html
Normal file
1
layouts/partials/meta_cache.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
<link rel="stylesheet" href="/css/styles.css{{ if $.Param "cacheBustCSS" }}?{{ readFile "/public/css/styles.css" | sha1 }}{{ end }}">
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
{{ if $.Param "jquery" }}<script src="/js/jquery.min.js"></script>{{ end }}
|
||||
{{ if and ($.Param "jquery") ($.Param "slicknav") }}<script src="/js/jquery.slicknav.min.js"></script>{{ end }}
|
||||
{{ if $.Param "jquery" }}<script src="/js/script.js{{ if $.Param "cacheBustJS" }}?{{ readFile "/public/js/script.js" | sha1 }}{{ end }}"></script>{{ end }}
|
||||
|
|
|
|||
1
layouts/partials/scripts_cache.html
Normal file
1
layouts/partials/scripts_cache.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{{ if $.Param "jquery" }}<script src="/js/script.js{{ if $.Param "cacheBustJS" }}?{{ readFile "/public/js/script.js" | sha1 }}{{ end }}"></script>{{ end }}
|
||||
Loading…
Reference in a new issue