{% assign tags_page = '' %} {% for static_page in site.pages %} {% if static_page.layout == 'tags' %} {% assign tags_page = static_page.url %} {% break %} {% endif %} {% endfor %} {% assign the_page = include.page | default: page %} {% if the_page.tags.size > 0 and tags_page.size > 0 %} {% assign full_tags = '' | split: ',' %} {% for tag in the_page.tags %} {% capture full_tag %}{{ tag }}{% endcapture %} {% assign full_tags = full_tags | push: full_tag %} {% endfor %} {% if include.short %} {% if full_tags.size > 1 %} / {% else %} / {% endif %} {% if full_tags.size > 2 %} {% capture suffix %}{{ full_tags.size | minus: 1 }} more{% endcapture %} {% assign updated_full_tags = '' | split: ',' %} {% for full_tag in full_tags limit: 1 %} {% assign updated_full_tags = updated_full_tags | push: full_tag %} {% endfor %} {% assign full_tags = updated_full_tags %} {% assign full_tags = full_tags | push: suffix %} {% endif %} {{ full_tags | join: ", " }} {% else %} {{ site.data.settings.post_tags }} {{ full_tags | array_to_sentence_string: "and" }}. {% endif %} {% endif %}