Skip to content

Commit

Permalink
Switch to using hugo.IsProduction
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Mar 10, 2024
1 parent 66acacd commit 16fac13
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{- $esbuildOptions := dict "target" "es2019" -}}

{{- if eq hugo.Environment "production" -}}
{{- if hugo.IsProduction -}}
{{- $esbuildOptions = merge $esbuildOptions (dict "minify" "true") -}}
{{- end -}}

Expand Down
2 changes: 1 addition & 1 deletion src/layouts/partials/stylesheet.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ $sassOptions := dict "targetPath" "/assets/css/style.css" "outputStyle" "expanded" "precision" 6 -}}
{{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}}

{{- if eq hugo.Environment "production" -}}
{{- if hugo.IsProduction -}}
{{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}}
{{- end -}}

Expand Down
3 changes: 1 addition & 2 deletions src/layouts/robots.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# www.robotstxt.org

{{- $isProduction := eq hugo.Environment "production" -}}
{{- $isNetlify := eq (getenv "NETLIFY") "true" -}}
{{- $allowCrawling := and (not $isNetlify) $isProduction -}}
{{- $allowCrawling := and (not $isNetlify) hugo.IsProduction -}}

{{ if $allowCrawling }}
# Allow crawling of all content
Expand Down

0 comments on commit 16fac13

Please sign in to comment.