Fix all the CSS resources templates

This commit is contained in:
Eryn Wells 2023-07-14 08:24:30 -07:00
parent da64dd30d5
commit 6740e7b61d
3 changed files with 48 additions and 24 deletions

View file

@ -1,5 +1,12 @@
{{ $pageCSS := dict }}
{{ $stylesheets := slice }}
{{ with .Resources.Match "*.css" }}
{{ $pageCSS = . | resources.Concat (printf "%s/page.css" $.File.Dir) | fingerprint "md5" }}
{{ range . }}
{{ $stylesheets = $stylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
{{ end }}
{{ if hugo.IsProduction }}
{{ $stylesheets = slice ($stylesheets
| resources.Concat (printf "%s/page.css" $.File.Dir)
| fingerprint "md5") }}
{{ end }}
{{ end }}
{{ return $pageCSS }}
{{ return $stylesheets }}