Setup Code Injection


Code injection is a feature that allows the user to paste in some javascript inside the Ghost admin to add code to the header or footer of their blog. This allows them to add features like Google Analytics, custom scripts, or whatever else to their blog without having to actually go in and edit the theme.

For theme developers, this means that you need to insert the ability for this to be possible inside the theme you are creating. This is very simple. All you need to do as the developer is add {{ghost_head}} and {{ghost_foot}} into your html.

{{ghost_head}} should go in the header and {{ghost_foot}} should go in your footer.

Here is what it looks like in Casper:

This is a small addition but saves the user of your theme a ton of time when they need to add something quickly.

This is a small addition but saves the user of your theme a ton of time when they need to add something quickly.