feat(environment): use hugo.Environment to judge the production environment

This commit is contained in:
Dillon
2020-03-02 17:03:35 +08:00
parent f83b1c14c8
commit 285efc01bb
5 changed files with 3 additions and 19 deletions

View File

@@ -5,7 +5,7 @@
{{- $scratch := newScratch -}}
{{- .Scratch.Set "scratch" $scratch -}}
{{- if eq (getenv "HUGO_ENV") "production" -}}
{{- if eq hugo.Environment "production" -}}
{{- $scratch.Set "production" true -}}
{{- $scratch.Set "CDN" .Site.Params.cdn -}}
{{- end -}}