feat: Don't minify when debug params is true
Pour se mettre en mode debug il faut modifier le fichier config.yml: params: debug: true On est obligé de passer par params puisque Hugo ne peut pas utiliser la variable debug directement
This commit is contained in:
parent
1221094d75
commit
2e74dbfa2b
|
@ -1,5 +1,9 @@
|
|||
{{ $js := resources.Get "js/main.js" }}
|
||||
{{ with $js }}
|
||||
{{ $secureJS := . | js.Build | resources.Minify | resources.Fingerprint }}
|
||||
{{ $secureJS := . | js.Build }}
|
||||
{{ if not $.Site.Params.debug }}
|
||||
{{ $secureJS = $secureJS | minify }}
|
||||
{{ end }}
|
||||
{{ $secureJS = $secureJS | fingerprint }}
|
||||
<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
|
||||
{{ end }}
|
||||
|
|
|
@ -1,2 +1,9 @@
|
|||
{{ $style := resources.Get "styles/main.sass" | toCSS | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
||||
{{ $style := resources.Get "styles/main.sass" }}
|
||||
{{ with $style }}
|
||||
{{ $styleCSS := . | toCSS }}
|
||||
{{ if not $.Site.Params.debug }}
|
||||
{{ $styleCSS = $styleCSS | minify }}
|
||||
{{ end }}
|
||||
{{ $styleCSS = $styleCSS | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styleCSS.Permalink }}" integrity="{{ $styleCSS.Data.Integrity }}">
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue