Closed mjpieters closed 5 years ago
The default layout almost never changes (aside from bumping a theme version number in comments) and is therefore safe for overriding.
You could add your script here by copying _layouts/default.html
to your repo and override the bundled one.
Right, that's another work-around then. Not ideal, not when adding additional scripts in the footer would be fairly common, I think?
Which is where footer_scripts
or overriding _includes/footer/custom.html
come into play.
But neither footer_scripts
nor _includes/footers/custom.html
let me place an extra script tag after the existing scripts (so after jQuery and magnific-popup have been loaded).
Have a look at PR #2116 and let me know if this meets your need.
You can test by using this gem in your Gemfile
gem 'minimal-mistakes-jekyll', :git => 'https://github.com/mmistakes/minimal-mistakes.git', :branch => 'after-footer-scripts'
And then adding your "after footer" script paths to _config.yml
like so:
after_footer_scripts:
- /assets/js/custom-script-loads-after-footer.js
This is absolutely perfect. It fits my needs exactly, I no longer would need to customise the default.html layout or scripts.html include.
It's currently very cumbersome to add scripts to the theme that must load in the footer to benefit from the jQuery support already present. Either we must
main.min.js
andhttps://use.fontawesome.com/releases/v5.7.1/js/all.js
(but without thedefer
,integrity
andcrossorigin
options), orscripts.html
include, orpackage.json
andbanner.js
files from GitHub (using the right versions) to be able to build the asset locally.Yet all I want to do is load one extra, small JS file to handle contact form submission with AJAX and some validation..
Please add a simple option to load additional scripts in the footer, in addition to
main.min.js
and font-awesome. Perhaps aextra_scripts
list?