Include jQuery in your project
5
You can include the same jQuery version October ships in your theme by using the @jquery
alias.
<script src="{{ ['@jquery'] | theme }}"></script>
By passing it as an array to the | theme
filter you'll get a new filename as soon as the content of the jQuery file changes. This makes sure that users will download the new version and not use a cached one.
You can also add additional files to the array to combine all of them into a single output file.
<script src="{{ ['@jquery', 'assets/another.js'] | theme }}"></script>
Google Lighthouse test doesn't like the jQuery delivered with OctoberCMS as it seems to be too old... :(
Hi, can you do something like this with bootstrap too? I tried
<link href="{{ ['@bootstrap'] | theme }}" rel="stylesheet">
but it didn't work. Thanks