Fix all the CSS resources templates
This commit is contained in:
parent
da64dd30d5
commit
6740e7b61d
3 changed files with 48 additions and 24 deletions
|
@ -1,21 +1,21 @@
|
|||
{{ $allStylesheets := slice (resources.Get "styles/root.css")
|
||||
(resources.Get "styles/railroad.css")
|
||||
(resources.Get "styles/monokai.css")
|
||||
| append (resources.Match "styles/root/*.css" | sort) }}
|
||||
{{ $stylesheets := slice (resources.Get "styles/root.css")
|
||||
(resources.Get "styles/railroad.css")
|
||||
(resources.Get "styles/monokai.css")
|
||||
| append (resources.Match "styles/root/*.css" | sort) }}
|
||||
{{ if not hugo.IsProduction }}
|
||||
{{ $allStylesheets = $allStylesheets | append (resources.Get "styles/development.css") }}
|
||||
{{ end }}
|
||||
|
||||
{{ $rootStylesheets := slice }}
|
||||
{{ range $stylesheets }}
|
||||
{{ $rootStylesheets = $rootStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $rootStylesheets = $allStylesheets
|
||||
| resources.ExecuteAsTemplate "styles/root.css" .
|
||||
| resources.Concat "styles/root.css"
|
||||
| minify | fingerprint "md5" }}
|
||||
{{ else }}
|
||||
{{ range $allStylesheets }}
|
||||
{{ $rootStylesheets = $rootStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
|
||||
{{ end }}
|
||||
{{ $rootStylesheets = slice ($rootStylesheets
|
||||
| resources.Concat "styles/root.css"
|
||||
| minify
|
||||
| fingerprint "md5") }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $rootStylesheets }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue