@customCommentsCode global variable

When you want to add support for Publii comments plugins, it is necessary to add support for customComments under supportedFeatures of the theme.

To add support for comments plugins, you must add the following code fragment in the place where comments should be displayed:

{{{@customCommentsCode}}}

For example our Simple theme implements this feature in the post.hbs file in the following way:

{{#if @config.post.displayComments}}
<div class="post__comments">
    <div class="wrapper">
        {{{@commentsCustomCode}}}
    </div>
</div>
{{/if}}

What means that comments are displayed only if they are enabled for the given post or globally under theme settings (if post uses global settings value).

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