How to add scripts to header and footer

Posted on 22 June 2021 at 9:54 by Wolfr_

For head-positioned JS, use the default headerScripts block in a template:

extends /templates/_layouts/master

block append headerScripts
    script(src='/js/my-file.js')


block body
    // My content

For footer-positioned JS, use the default footerScripts block:

extends /templates/_layouts/master

block append footerScripts
    script(src='/js/my-file.js')

block body
    // My content

Leave a Reply

Your email address will not be published. Required fields are marked *