From cce85ea4ed22169ff5766b7898bde7ffc2a079e4 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 3 Jan 2022 13:12:38 +0000 Subject: [PATCH] Only load styles on pages which need it --- layouts/_default/baseof.html | 4 ---- layouts/_default/flickr.html | 2 -- layouts/_default/single.html | 9 +++++++++ layouts/_default/spotify.html | 8 ++++++++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 5eb913d..ad328ca 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -12,8 +12,6 @@ {{ partial "style.html" "scss/style.scss" }} {{ partial "style.html" "css/font-awesome.css" }} - {{ partial "style.html" "css/highlight.css" }} - {{ partial "style.html" "css/shareon.css" }} {{ block "style_extra" . }}{{ end }} @@ -38,8 +36,6 @@ {{ partial "script_async.html" "js/app.js" }} - {{ partial "script_async.html" "js/shareon.js" }} - {{ block "scripts_extra" . }}{{ end }} {{ if not .Site.IsServer }} diff --git a/layouts/_default/flickr.html b/layouts/_default/flickr.html index 13c2c1e..47416ee 100644 --- a/layouts/_default/flickr.html +++ b/layouts/_default/flickr.html @@ -23,8 +23,6 @@ - {{ partial "share.html" . }} - {{ partial "related-content.html" . }} {{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index faacd70..11a1b70 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -7,3 +7,12 @@ {{ partial "related-content.html" . }} {{ end }} + +{{ define "style_extra" }} + {{ partial "style.html" "css/shareon.css" }} + {{ partial "style.html" "css/highlight.css" }} +{{ end }} + +{{ define "scripts_extra" }} + {{ partial "script_async.html" "js/shareon.js" }} +{{ end }} diff --git a/layouts/_default/spotify.html b/layouts/_default/spotify.html index 6f42e95..c110d3f 100644 --- a/layouts/_default/spotify.html +++ b/layouts/_default/spotify.html @@ -56,3 +56,11 @@ {{ partial "related-content.html" . }} {{ end }} + +{{ define "style_extra" }} + {{ partial "style.html" "css/shareon.css" }} +{{ end }} + +{{ define "scripts_extra" }} + {{ partial "script_async.html" "js/shareon.js" }} +{{ end }}