layout/default: use Hugo to bundle the JS files

This commit is contained in:
liushuyu 2022-05-07 16:44:24 -06:00
parent f286ee6320
commit 95be508e27
No known key found for this signature in database
GPG key ID: 23D1CE4534419437

View file

@ -101,7 +101,8 @@
</footer> </footer>
</div> </div>
<script src="{{ .Site.BaseURL }}/js/script.js"></script> {{ $mainJs := resources.Match "js/**.js" | resources.Concat "js/script.js" | minify | fingerprint }}
<script src="{{ $mainJs.Permalink }}" integrity="{{ $mainJs.Data.Integrity }}"></script>
{{- block "scripts" . }}{{- end }} {{- block "scripts" . }}{{- end }}
{{- if eq (getenv "HUGO_ENV") "PRD" }} {{- if eq (getenv "HUGO_ENV") "PRD" }}