This post was originally published at stevemerc.com
I recently found myself needing to add some custom JavaScript to the head of a Gatsby pro...
For further actions, you may consider blocking this person and/or reporting abuse
Please try and avoid ejecting html.js unless you have to. The out of the box APIs could accomplish adding a script to the head
gatsbyjs.org/docs/ssr-apis/#onRend...
Hi Tommy, thanks for mentioning
onRenderBody. You're right that it can be used to render custom scripts in thehead, but I still think there's value in knowing how to manually tweakhtml.jsfor fine-grained control. I'll update this article to include an example usingonRenderBody, though.