From 465a3bb14d712dc914ea4cc9c266ed4550b15cc7 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Wed, 12 Jan 2022 12:15:23 +0100 Subject: [PATCH] concat javascript files into 1 main script file to avoid loading too many javascript files we concat everything into 1 main javascript file then we minify it and use it for optimal speed and loading Signed-off-by: Toshaan Bharvani --- .../layouts/partials/footer.html | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/themes/openpowerfoundation/layouts/partials/footer.html b/themes/openpowerfoundation/layouts/partials/footer.html index 71e5dd5..ab9186e 100644 --- a/themes/openpowerfoundation/layouts/partials/footer.html +++ b/themes/openpowerfoundation/layouts/partials/footer.html @@ -50,20 +50,13 @@ {{ $mainjavascript := resources.Get "js/main.js" }} -{{ $mainjs := $mainjavascript | resources.Minify }} - {{ $jqueryformjavascript := resources.Get "js/jquery.form.js" }} -{{ $jqueryformjs := $jqueryformjavascript | resources.Minify }} - {{ $formjavascript := resources.Get "js/form.js" }} -{{ $formjs := $formjavascript | resources.Minify }} - {{ $changelogjavascript := resources.Get "js/changelog.js" }} -{{ $changelogjs := $changelogjavascript | resources.Minify }} - {{ $selectjavascript := resources.Get "js/select.js" }} -{{ $selectjs := $selectjavascript | resources.Minify }} - +{{ $javascripts := slice $mainjavascript $jqueryformjavascript $formjavascript $changelogjavascript $selectjavascript | resources.Concat "js/scripts.js" }} +{{ $javascript := $javascripts | resources.Minify }} + {{ if .Site.Params.analytics.piwik }} {{ partial "_analytics/piwik.html" . }} {{ end }}