I’m creating a complex website and I’m using in general jQuery. On some pages (markdown files) I would like to add a document.ready function . How can I put some JavaScript code inside the markdown file?
My first idea is to create a page property, which is put inside the header if it is set. But is there any buildin functionality to put page specialized JavaScript code to a page?
Thanks for that, but I understand it in this case, that I can define a JavaScript file and include it by a block structure, but in my case I would like to add “inline JavaScript code”.
You can include regular HTML in you Markdown files. So a <script> tag should work. Maybe it can happen that Go templates escape them for security reasons (unless Hugo trusts the user and marks it as safe by default).