mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 03:00:50 +02:00
feat: delay PostCSS processing with resources.PostProcess
resources.PostProcess delays processing of a resource until the rest of the build has finished. This allows the public folder or Hugo's hugo_stats.json file to be used as the content for PurgeCSS, so that only CSS that is used on the final website will be included. Close #2318
This commit is contained in:
parent
70cef473ae
commit
01a25ecaec
1 changed files with 4 additions and 0 deletions
|
@ -198,6 +198,10 @@
|
|||
{{- if hugo.IsProduction -}}
|
||||
{{- $style = $style | fingerprint "md5" -}}
|
||||
{{- end -}}
|
||||
{{- if eq (getenv "WC_POST_CSS") "true" -}}
|
||||
{{/* PostProcess must be last action in the pipeline */}}
|
||||
{{- $style = $style | resources.PostProcess -}}
|
||||
{{- end -}}
|
||||
<link rel="stylesheet" href="{{ $style.RelPermalink }}" />
|
||||
|
||||
{{ partial "marketing/google_analytics" . }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue