Skip to content

Commit

Permalink
Use hugo.IsProduction to determine build environment
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin committed Aug 19, 2021
1 parent efdc5bf commit a4f64cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion layouts/partials/head-css.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

{{ $scssMain := "scss/main.scss"}}
{{ if .Site.IsServer }}
{{ if not hugo.IsProduction }}
{{/* Note the missing postCSS. This makes it snappier to develop in Chrome, but makes it look sub-optimal in other browsers. */}}
{{ $css := resources.Get $scssMain | toCSS (dict "enableSourceMap" true) }}
<link href="{{ $css.RelPermalink }}" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
{{ $jsSearch = resources.Get "js/offline-search.js" }}
{{ end }}
{{ $js := (slice $jsBase $jsAnchor $jsSearch $jsMermaid $jsPlantuml $jsMarkmap) | resources.Concat "js/main.js" }}
{{ if .Site.IsServer }}
{{ if not hugo.IsProduction }}
<script src="{{ $js.RelPermalink }}"></script>
{{ else }}
{{ $js := $js | minify | fingerprint }}
Expand Down

0 comments on commit a4f64cf

Please sign in to comment.