From ef5b5b75406322cfd71524d8aa716abf523f5a6a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 3 Jul 2021 12:20:29 +0100 Subject: [PATCH] Use dedicated shareon file This means the main JS file is smaller --- layouts/_default/baseof.html | 2 ++ scripts/build.sh | 1 + static/src/js/app.js | 3 --- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index f927526..b2f11e3 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -42,6 +42,8 @@ {{ partial "script_async.html" "js/app.js" }} + {{ partial "script_async.html" "js/shareon.js" }} + {{ block "scripts_extra" . }}{{ end }} {{ if not .Site.IsServer }} diff --git a/scripts/build.sh b/scripts/build.sh index c169dc5..3d3adf7 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -20,6 +20,7 @@ cp $BASEDIR/node_modules/shareon/dist/shareon.min.css $STATIC_BUILD/css/shareon. cp -r $STATIC_SRC/js/ $STATIC_BUILD/js/ cp $BASEDIR/node_modules/jquery/dist/jquery.min.js $STATIC_BUILD/js/jquery.min.js +cp $BASEDIR/node_modules/shareon/dist/shareon.min.js $STATIC_BUILD/js/shareon.js cp $BASEDIR/node_modules/lightgallery/dist/js/lightgallery-all.min.js $STATIC_BUILD/js/lightgallery.min.js cp $BASEDIR/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js $STATIC_BUILD/js/bootstrap.min.js cp $BASEDIR/node_modules/elevator.js/demo/music/*.mp3 $STATIC_BUILD/audio/ diff --git a/static/src/js/app.js b/static/src/js/app.js index 68b96ac..8f38143 100644 --- a/static/src/js/app.js +++ b/static/src/js/app.js @@ -1,5 +1,4 @@ const Elevator = require('elevator.js'); -const shareon = require('shareon'); function waitFor(obj, property, callback) { // Wait for a property to exist on window before running callback @@ -53,8 +52,6 @@ $(document).ready(function() { endAudio: '/audio/ding.mp3', preloadAudio: false, }); - - shareon(); }); function scrollTo(offset) {