From 02b02d3ac181309fc9aeef2454482d2a71af222c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 1 Dec 2018 17:03:46 +0000 Subject: [PATCH] Use async scripts, and remove thumbnail plugin to make it easier --- layouts/_default/baseof.html | 9 ++++----- layouts/partials/script_async.html | 2 ++ scripts/build.sh | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 layouts/partials/script_async.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 8d581cb..d54fe58 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -27,10 +27,9 @@ {{ partial "footer.html" . }} {{ partial "script.html" "js/jquery.min.js" }} - {{ partial "script.html" "js/lightgallery.js" }} - {{ partial "script.html" "js/lg-thumbnail.min.js" }} - {{ partial "script.html" "js/bootstrap.min.js" }} - {{ partial "script.html" "js/mermaid.min.js" }} - {{ partial "script.html" "js/app.js" }} + {{ partial "script_async.html" "js/lightgallery.js" }} + {{ partial "script_async.html" "js/bootstrap.min.js" }} + {{ partial "script_async.html" "js/mermaid.min.js" }} + {{ partial "script_async.html" "js/app.js" }} diff --git a/layouts/partials/script_async.html b/layouts/partials/script_async.html new file mode 100644 index 0000000..c1c59cc --- /dev/null +++ b/layouts/partials/script_async.html @@ -0,0 +1,2 @@ +{{ $script := resources.Get . | minify | fingerprint }} + diff --git a/scripts/build.sh b/scripts/build.sh index d11e217..c02cf4e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -14,7 +14,6 @@ cp -r $BASEDIR/node_modules/lightgallery/dist/img/* $STATIC_BUILD/img cp $BASEDIR/node_modules/jquery/dist/jquery.min.js $STATIC_BUILD/js/jquery.min.js cp $BASEDIR/node_modules/lightgallery/dist/js/lightgallery.js $STATIC_BUILD/js/lightgallery.js -cp $BASEDIR/node_modules/lg-thumbnail/dist/lg-thumbnail.min.js $STATIC_BUILD/js/lg-thumbnail.min.js cp $BASEDIR/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js $STATIC_BUILD/js/bootstrap.min.js cp $BASEDIR/node_modules/mermaid/dist/mermaid.min.js $STATIC_BUILD/js/mermaid.min.js