Skip to content

Commit

Permalink
fix(v4): adjust Hugo environment validation in css.html and js.html (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-baiborodine authored Aug 29, 2023
1 parent 884a849 commit aa76d18
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions v4/exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ googleAnalytics = ""
disqusShortname = ""

[params]
# theme.css and theme.js will not be minified, and integrity will not be added
env = "DEV"

# Custom CSS/JS modules that will be imported by the template.
# Files are relative to the static/ directory or a URL.
# Files are imported in the order they appear here, after
Expand Down
2 changes: 1 addition & 1 deletion v4/layouts/partials/css.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ $options := dict "targetPath" "theme.css" "enableSourceMap" true "precision" 6 }}
{{ $css := resources.Get "sass/theme.scss" | resources.ExecuteAsTemplate "theme.scss" . | toCSS $options }}

{{ if or (.Site.IsServer) (eq .Site.Params.env "DEV") }}
{{ if or (.Site.IsServer) (eq hugo.Environment "development") }}
<link rel="stylesheet" href="{{ $css.Permalink }}" media="screen">
{{ else }}
{{ $css := $css | resources.Minify | resources.Fingerprint }}
Expand Down
2 changes: 1 addition & 1 deletion v4/layouts/partials/js.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

{{ $js := $jsToConcat | resources.Concat "theme.js" }}

{{ if or (.Site.IsServer) (eq .Site.Params.env "DEV") }}
{{ if or (.Site.IsServer) (eq hugo.Environment "development") }}
<script src="{{ $js.Permalink }}"></script>
{{ else }}
{{ $js := $js | resources.Minify | resources.Fingerprint }}
Expand Down

0 comments on commit aa76d18

Please sign in to comment.