{{- $funcPath := "js/functions.js" }}
|
{{- $functions := resources.Get $funcPath | resources.ExecuteAsTemplate $funcPath . }}
|
|
{{- $lunrPath := "js/lunr.js" }}
|
{{- $lunr := resources.Get $lunrPath | resources.ExecuteAsTemplate $lunrPath . }}
|
|
{{- $searchPath := "js/search.js" }}
|
{{- $search := resources.Get $searchPath | resources.ExecuteAsTemplate $searchPath . }}
|
|
{{- $mainScriptPath := "js/index.js" }}
|
{{- $main := resources.Get $mainScriptPath | resources.ExecuteAsTemplate $mainScriptPath . }}
|
|
{{- $bundle := slice $functions $main | resources.Concat "js/bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
|
{{- $bundle2 := slice $lunr $search | resources.Concat "js/search.js" | resources.Minify | resources.Fingerprint "sha512" }}
|
<script src = '{{ $bundle.Permalink }}'></script>
|
<script src = '{{ $bundle2.Permalink }}' async></script>
|