@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.

Create your first website with Publii

Join thousands of creators who chose independence. Create content locally and publish lightning-fast, secure websites on your own terms.

Download Publii

Free and open source. Windows, macOS and Linux.

Read the getting started guide