How to add JavaScript to head of each page in a book #1576
-
Hi! I’d like to add a few lines of JavaScript (in a script tag) to the head of each page created in the render process for an html book I’m writing with quarto. What’s the simplest way to do this? For instance, is there a way to set this up through an option in the project config file? The docs hint that this is done by putting a js file in a directory named with a leading underscore, and then pointing to that directory with the ‘lib_dir’ option in the config. But the docs don’t spell out explicitly what effect this will have on the site that’s ultimately rendered, so it makes me a little nervous to go that route without learning more. thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think you are searching for HTML includes option You can configure those in the project configuration file where you defined the format to use. Did you try that already ? |
Beta Was this translation helpful? Give feedback.
I think you are searching for HTML includes option
https://quarto.org/docs/output-formats/html-basics.html#includes
You can configure those in the project configuration file where you defined the format to use.
Did you try that already ?