Sha256: 02e9b3519f5f14ff0860f109d2bcab8d36441c90283eeee25b604fc13064b08f

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

{% 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 %}<a href="{{ tags_page }}#{{ tag | slugify }}">{{ tag }}</a>{% endcapture %}
	{% assign full_tags = full_tags | push: full_tag %}
{% endfor %}

{% if include.short %}

	{% if full_tags.size > 1 %}
	/ <i class="fa fa-tags" aria-hidden="true"></i>
	{%  else %}
	/ <i class="fa fa-tag" aria-hidden="true"></i>
	{% endif %}

	{% if full_tags.size > 2 %}
		{% capture suffix %}{{ full_tags.size | minus: 1 }} more</a>{% 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 %}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jekyll-theme-harveynick-lagrange-3.0.3 _includes/post-tags.html