blob: 1b001d23cd05da3b1f768d1f087e0ed08144dd76 (
plain)
1
2
3
4
5
6
7
8
9
|
{{- $js := resources.Get "js/index.js" -}}
{{ $params := (dict "search_config" site.Params.search_config "is_production" hugo.IsProduction ) }}
{{ $sourceMap := cond hugo.IsProduction "" "inline" }}
{{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }}
{{ $js = $js | js.Build $opts }}
{{ if hugo.IsProduction }}
{{ $js = $js | fingerprint }}
{{ end }}
<script src="{{ $js.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $js.Data.Integrity }}"{{ end }} defer></script>
|