2023-07-14 08:24:30 -07:00
|
|
|
{{ $stylesheetName := printf "styles/%s.css" .Section }}
|
|
|
|
|
|
|
|
{{ $stylesheets := slice }}
|
|
|
|
{{ if gt (len .Section) 0 }}
|
|
|
|
{{ with resources.Match (printf "styles/%s/*" .Section) }}
|
|
|
|
{{ $stylesheets = . }}
|
|
|
|
{{ else }}
|
|
|
|
{{ with resources.Get $stylesheetName }}
|
|
|
|
{{ $stylesheets = (slice .) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2022-11-08 17:50:11 -08:00
|
|
|
{{ end }}
|
2023-07-14 08:24:30 -07:00
|
|
|
|
|
|
|
{{ $sectionStylesheets := slice }}
|
|
|
|
{{ if $stylesheets }}
|
|
|
|
{{ range $stylesheets }}
|
|
|
|
{{ $sectionStylesheets = $sectionStylesheets | append (. | resources.ExecuteAsTemplate .Name .) }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ if hugo.IsProduction }}
|
|
|
|
{{ $sectionStylesheets = slice ($sectionStylesheets
|
|
|
|
| resources.Concat $stylesheetName
|
|
|
|
| minify
|
|
|
|
| fingerprint "md5") }}
|
|
|
|
{{ end }}
|
2022-11-08 17:50:11 -08:00
|
|
|
{{ end }}
|
2023-07-14 08:24:30 -07:00
|
|
|
|
|
|
|
{{ return $sectionStylesheets }}
|