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

17 lines
663 B
HTML
Raw Normal View History

2020-09-13 18:51:28 +00:00
{{ $main := resources.Get "js/main.js" }}
{{ $menu := resources.Get "js/menu.js" }}
{{ $prism := resources.Get "js/prism.js" }}
{{ $theme := resources.Get "js/theme.js" }}
{{ $secureJS := slice $main $menu $prism $theme | resources.Concat "bundle.js" | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $secureJS.RelPermalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
{{- if .Site.GoogleAnalytics }}
{{ template "_internal/google_analytics.html" . }}
{{- end}}
{{ range $val := $.Site.Params.customJS }}
{{ if gt (len $val) 0 }}
<script src="{{ $val }}"></script>
{{ end }}
{{ end }}