/_includes/JB/tags_list
#! | 33 lines | 30 code | 3 blank | 0 comment | 0 complexity | 42c02f851a293ab161d4babda3ae7363 MD5 | raw file
1{% comment %}<!--
2The tags_list include is a listing helper for tags.
3Usage:
4 1) assign the 'tags_list' variable to a valid array of tags.
5 2) include JB/tags_list
6 example:
7 <ul>
8 {% assign tags_list = site.tags %}
9 {% include JB/tags_list %}
10 </ul>
11
12 Notes:
13 Tags can be either a Hash of tag objects (hashes) or an Array of tag-names (strings).
14 The encapsulating 'if' statement checks whether tags_list is a Hash or Array.
15 site.tags is a Hash while page.tags is an array.
16
17 This helper can be seen in use at: ../_layouts/default.html
18-->{% endcomment %}
19
20{% if site.JB.tags_list.provider == "custom" %}
21 {% include custom/tags_list %}
22{% else %}
23 {% if tags_list.first[0] == null %}
24 {% for tag in tags_list %}
25 <li><a href="{{ BASE_PATH }}{{ site.JB.tags_path }}#{{ tag }}-ref">{{ tag }} <span>{{ site.tags[tag].size }}</span></a></li>
26 {% endfor %}
27 {% else %}
28 {% for tag in tags_list %}
29 <li><a href="{{ BASE_PATH }}{{ site.JB.tags_path }}#{{ tag[0] }}-ref">{{ tag[0] }} <span>{{ tag[1].size }}</span></a></li>
30 {% endfor %}
31 {% endif %}
32{% endif %}
33{% assign tags_list = nil %}