GitHub Download

@customHTML global variable

The @customHTML global variable contains an object with custom HTML code defined by theme author. To create custom HTML areas in your theme, you need to add the customHTML section in the renderer section of the theme config.json file:

"renderer": {
    "renderRelatedPosts": false,
    "renderSimilarPosts": false,
    "renderPrevNextPosts": false,
    "createContentStructure": false,
    "customHTML": {
        "beforePost": "Before every post",
        "afterPost": "After every post"

Above code will create two new custom HTML sections - beforePost and afterPost - they are available through @customHTML.beforePost and @customHTML.afterPost variables.

The custom HTML code for these sections can be defined under Tools -> Custom HTML section of Publii.


Get the latest Publii news, updates and more delivered directly to your email inbox

You can change your mind at any time by clicking the unsubscribe link in the footer of any email you receive from us, or by contacting us at By clicking below, you agree that we may process your information in accordance with our Privacy Policy.