From 45bcf3f642ddaf85df9ebe5de2733a371d24a61e Mon Sep 17 00:00:00 2001 From: Marcell Mars Date: Thu, 10 Sep 2020 12:15:24 +0200 Subject: [PATCH] no more fingerprints after css which simplifies setup for all hugo envs... --- themes/sandpoints/layouts/partials/css.html | 31 ++++----------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/themes/sandpoints/layouts/partials/css.html b/themes/sandpoints/layouts/partials/css.html index 18938f6..d584261 100644 --- a/themes/sandpoints/layouts/partials/css.html +++ b/themes/sandpoints/layouts/partials/css.html @@ -1,30 +1,9 @@ {{ if (or (eq hugo.Environment "gitea") (eq hugo.Environment "preview") ) }} - - -{{ else if .Site.IsServer }} + + +{{ else if (or (eq hugo.Environment "offline") (.Site.IsServer)) }} {{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }} - + {{ $style := resources.Get "css/player.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }} - -{{ else }} - {{ $flist := newScratch }} - {{ $flist.Set "initial" "nop" }} - {{ range (readDir "public/css") }} - {{ $finfo := os.Stat (printf "%s%s" "public/css/" .Name) }} - {{ $flist.SetInMap "css_files" (printf "%s" $finfo.ModTime) .Name }} - {{ $flist.Set "initial" "yay" }} - {{ end }} - - {{ $css := "nop" }} - - {{ if eq ($flist.Get "initial") "yay" }} - {{ $css = (index (last 1 ( $flist.GetSortedMapValues "css_files" )) 0) }} - {{ end }} - - {{ if in $css "css" }} - - {{ else }} - {{ $style := resources.Get "css/site.css" | postCSS (dict "config" "./assets/css/postcss.config.js") | minify }} - - {{ end }} + {{ end }}