From 9341e736fc758699a3f232806817f0dd74a6b2aa Mon Sep 17 00:00:00 2001 From: Bing-Sheng Chen Date: Thu, 1 Aug 2019 14:47:14 +0800 Subject: refactor(partial): Create a partial of JavaScript Create JavaScript partial and make it cacheable. See also: https://github.com/google/docsy/blob/master/layouts/_default/baseof.html --- layouts/_default/baseof.html | 1 + layouts/partials/footer.html | 3 --- layouts/partials/scripts.html | 3 +++ 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 layouts/partials/scripts.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 696b038..175311c 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -7,6 +7,7 @@ {{- block "main" . }}{{- end }} {{- partial "footer.html" . -}} + {{- partialCached "scripts.html" . -}} {{- template "_internal/google_analytics.html" . -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index f6635c5..dfb7fc0 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -2,6 +2,3 @@ {{ partial "lang-selector.html" . }} Powered by Hugo -{{ $highlight := resources.Get "js/highlight.pack.js" | fingerprint }} - - diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 0000000..f7384a0 --- /dev/null +++ b/layouts/partials/scripts.html @@ -0,0 +1,3 @@ +{{ $highlight := resources.Get "js/highlight.pack.js" | fingerprint }} + + -- cgit v1.2.3