Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/s4n7h0/hugo-theme-timeline.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials/javascript.html')
-rw-r--r--layouts/partials/javascript.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/layouts/partials/javascript.html b/layouts/partials/javascript.html
new file mode 100644
index 0000000..02bdd8d
--- /dev/null
+++ b/layouts/partials/javascript.html
@@ -0,0 +1,16 @@
+{{ $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 }}