Js for specific page

Hi there,

What would be the best way to define javascript code (inside ) for a specific page template ?

Like on my .html file, I’d be able to define a “yield” / “push” block which would be rendered at the bottom - near all the other tags - and not where I defined it in the .html file.

Thanks.

Hard to tell exactly what you’re trying to do, but it sounds like you could use block templates and then, if you need data from the main block where your template logic is, use Scratch to pass variables from one block to another. This is a good place to start: https://gohugo.io/templates/base/