From 2bcf1168c84aa0b3bfae2fd0464d780aa9c73c12 Mon Sep 17 00:00:00 2001 From: Fredrik Jonsson Date: Sun, 25 Jun 2017 17:59:53 +0200 Subject: [PATCH] Move meta and script tags that need cached to *_cached partials. --- layouts/_default/baseof.html | 7 ++++--- layouts/index.html | 3 ++- layouts/partials/meta.html | 2 +- layouts/partials/meta_cache.html | 1 + layouts/partials/scripts.html | 1 - layouts/partials/scripts_cache.html | 1 + 6 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/meta_cache.html create mode 100644 layouts/partials/scripts_cache.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e41b2a8..b61deec 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,8 +4,8 @@ {{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }} {{ block "meta" . }}{{ end }} -{{- partialCached "meta.html" . -}} - +{{- partial "meta.html" . -}} +{{- partialCached "meta_cache.html" . -}} {{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID }}{{ partialCached "piwik.html" . }}{{ end -}} @@ -30,6 +30,7 @@ {{ if $.Param "poweredby" }}

Powered by Hugo

{{ end -}} -{{ partialCached "scripts.html" . }} +{{ partial "scripts.html" . -}} +{{ partialCached "scripts_cache.html" . -}} diff --git a/layouts/index.html b/layouts/index.html index 57af4b4..0bff20a 100644 --- a/layouts/index.html +++ b/layouts/index.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" -}} diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 8663af9..681b7f3 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -3,5 +3,5 @@ {{ .Hugo.Generator }} {{ with $.Param "contact" }}{{ end }} - + diff --git a/layouts/partials/meta_cache.html b/layouts/partials/meta_cache.html new file mode 100644 index 0000000..8427c31 --- /dev/null +++ b/layouts/partials/meta_cache.html @@ -0,0 +1 @@ + diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index 75cdd9b..eaea3ac 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -1,3 +1,2 @@ {{ if $.Param "jquery" }}{{ end }} {{ if and ($.Param "jquery") ($.Param "slicknav") }}{{ end }} -{{ if $.Param "jquery" }}{{ end }} diff --git a/layouts/partials/scripts_cache.html b/layouts/partials/scripts_cache.html new file mode 100644 index 0000000..4532ea1 --- /dev/null +++ b/layouts/partials/scripts_cache.html @@ -0,0 +1 @@ +{{ if $.Param "jquery" }}{{ end }}