Teach resources/page_css how to load CSS stylesheets with .Kind
This commit is contained in:
parent
851c74b2c9
commit
c94c4a6c95
1 changed files with 19 additions and 7 deletions
|
@ -1,12 +1,24 @@
|
||||||
{{ $stylesheets := slice }}
|
{{ $stylesheets := slice }}
|
||||||
{{ with .Resources.Match "*.css" }}
|
{{ with .Resources.Match "*.css" }}
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
{{ $stylesheets = $stylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
|
{{ $stylesheets = $stylesheets | append . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if eq .Kind "home" }}
|
||||||
|
{{ with resources.Get "styles/home.css" }}
|
||||||
|
{{ $stylesheets = $stylesheets | append . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $processedStylesheets := slice }}
|
||||||
|
{{ range $stylesheets }}
|
||||||
|
{{ $processedStylesheets = $processedStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if hugo.IsProduction }}
|
{{ if hugo.IsProduction }}
|
||||||
{{ $stylesheets = slice ($stylesheets
|
{{ $processedStylesheets = slice ($processedStylesheets
|
||||||
| resources.Concat (printf "%s/page.css" $.File.Dir)
|
| resources.Concat (printf "%s/page.css" $.File.Dir)
|
||||||
| fingerprint "md5") }}
|
| fingerprint "md5") }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
{{ return $stylesheets }}
|
{{ return $processedStylesheets }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue