{% set COLUMN_NUMBER = 3 %}
{% for photo in post.photos %}
{% if loop.index0 % COLUMN_NUMBER === 0 %}{% endif %}
{% endfor %}
{# Append end tag for `post-gallery-row` when (photos size mod COLUMN_NUMBER) is less than COLUMN_NUMBER #}
{% if post.photos.length % COLUMN_NUMBER > 0 %}
{% endif %}
{% if not headlessPost %}
{# Not to show title for quote posts that do not have a title #}
{% if not (is_index and post.type === 'quote' and not post.title) %}
<{% if theme.seo %}h2{% else %}h1{% endif %} class="post-title{% if post.direction && post.direction.toLowerCase() === 'rtl' %} rtl{% endif %}" itemprop="name headline">{#
#}{# Link posts #}{#
#}{% if post.link %}
{% if post.sticky > 0 %}
{{ post.sticky }}
{% endif %}
{{ post.title or post.link }}
{% else %}{#
#}{% if is_index %}
{% if post.sticky > 0 %}
{% endif %}
{#
#}{{ post.title | default(__('post.untitled'))}}{#
#}{#
#}{% else %}
{{ post.title }}
{% if theme.post_edit.enable %}
{% endif %}
{% endif %}{#
#}{% endif %}{#
#}{% if theme.seo %}h2{% else %}h1{% endif %}>
{% endif %}
{% endif %}
{#################}
{### POST BODY ###}
{#################}
{% if theme.related_posts.enable and (theme.related_posts.display_in_home or not is_index) %}
{% include 'post-related.swig' with { post: post } %}
{% endif %}
{#####################}
{### END POST BODY ###}
{#####################}
{% if theme.wechat_subscriber.enabled and not is_index %}
{# Gallery support #}
{% if post.photos and post.photos.length %}
{% endif %}
{% if is_index %}
{% if post.description and theme.excerpt_description %}
{{ post.description }}
{% elif post.excerpt %}
{{ post.excerpt }}
{% elif theme.auto_excerpt.enable %}
{% set content = post.content | striptags %}
{{ content.substring(0, theme.auto_excerpt.length) }}
{% if content.length > theme.auto_excerpt.length %}...{% endif %}
{% else %}
{% if post.type === 'picture' %}
{{ post.content }}
{% else %}
{{ post.content }}
{% endif %}
{% endif %}
{% else %}
{{ post.content }}
{% endif %}
{% include 'wechat-subscriber.swig' %}
{% endif %}
{% if (theme.alipay or theme.wechatpay or theme.bitcoin) and not is_index %}
{% include 'reward.swig' %}
{% endif %}
{% if theme.post_copyright.enable and not is_index %}
{% include 'post-copyright.swig' with { post: post } %}
{% endif %}
{######################}
{### END POST BLOCK ###}
{######################}