mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-25 10:50:50 +02:00
feat: run PostCSS on vendor CSS (#2644)
Currently, PostCSS can optionally be run on the main CSS bundle. This commit allows PostCSS to also be run on the vendor CSS. This can greatly reduce the size of the vendor CSS bundle when combined with PurgeCSS since most of the Font Awesome CSS is unused.
This commit is contained in:
parent
381a6c2073
commit
7d4f8d5650
1 changed files with 7 additions and 0 deletions
|
@ -101,9 +101,16 @@
|
|||
{{- $stylesheets = $stylesheets | append (resources.Get (printf "css/libs/%s.css" . ) ) -}}
|
||||
{{- end -}}
|
||||
{{ $stylesheets = $stylesheets | resources.Concat "css/vendor-bundle.css" | minify }}
|
||||
{{- if eq (getenv "WC_POST_CSS") "true" -}}
|
||||
{{- $stylesheets = $stylesheets | postCSS -}}
|
||||
{{- end -}}
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{- $stylesheets = $stylesheets | fingerprint "md5" -}}
|
||||
{{- end -}}
|
||||
{{- if eq (getenv "WC_POST_CSS") "true" -}}
|
||||
{{/* PostProcess must be last action in the pipeline */}}
|
||||
{{- $stylesheets = $stylesheets | resources.PostProcess -}}
|
||||
{{- end -}}
|
||||
<link rel="stylesheet" href="{{$stylesheets.RelPermalink}}" media="print" onload="this.media='all'">
|
||||
|
||||
{{ $scr.Set "vendor_css_filename" "main.min.css" }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue