blog/themes/next/layout/_partials/comments.njk

36 lines
1.5 KiB
Plaintext

{%- if page.comments %}
{%- if theme.injects.comment.length == 1 %}
{%- set inject_item = theme.injects.comment[0] %}
{{ partial(inject_item.layout, inject_item.locals, inject_item.options) }}
{%- elif theme.injects.comment.length > 1 %}
{%- if theme.comments.style == 'buttons' %}
<div class="comment-button-group">
{%- for inject_item in theme.injects.comment %}
<a class="btn comment-button {{ inject_item.locals.class }}">{{ inject_item.locals.button }}</a>
{%- endfor %}
</div>
{%- for inject_item in theme.injects.comment %}
<div class="comment-position {{ inject_item.locals.class }}">
{{ partial(inject_item.layout, inject_item.locals, inject_item.options) }}
</div>
{%- endfor %}
{{- next_js('comments-buttons.js', { pjax: true }) }}
{%- elif theme.comments.style == 'tabs' %}
<div class="tabs tabs-comment">
<ul class="nav-tabs">
{%- for inject_item in theme.injects.comment %}
<li class="tab"><a href="#comment-{{ inject_item.locals.class }}">{{ inject_item.locals.button }}</a></li>
{%- endfor %}
</ul>
<div class="tab-content">
{%- for inject_item in theme.injects.comment %}
<div class="tab-pane {{ inject_item.locals.class }}" id="comment-{{ inject_item.locals.class }}">
{{ partial(inject_item.layout, inject_item.locals, inject_item.options) }}
</div>
{%- endfor %}
</div>
</div>
{%- endif %}
{%- endif %}
{%- endif %}