blog/themes/hello-friend-ng/layouts/partials/javascript.html

13 lines
558 B
HTML

2022-07-06 15:45:22 +07:00
{{ $main := resources.Get "js/main.js" }}
{{ $menu := resources.Get "js/menu.js" }}
{{ $hljs := resources.Get "js/highlight.min.js" }}
{{ $secureJS := slice $main $menu $hljs | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $secureJS.RelPermalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
<script>hljs.highlightAll();</script>
{{ range $val := $.Site.Params.customJS }}
{{ if gt (len $val) 0 }}
<script src="{{ $val }}"></script>
{{ end }}
{{ end }}