Jekyll Tips

October 28, 2018

To present tag posts count use tag[1].size

1{% for tag in site.tags %}
2 <li><a href="/path_to_tags/{{ tag[0] | slugify }}">{{ tag[0] }}</a> <{{tag[1].size}}></li>
3{% endfor %}

To display a ruby code but prevent compiler from render it, use {% raw %}

1{% raw %}
2 {% for tag in site.tags %}
3 ...
4 {% endfor %}
5{% endraw %}
© 2021 - Moshe Feuchtwander