initial commit with jekyll-boostrap
[openjpeg.git] / _includes / JB / categories_list
1 {% comment %}<!--
2 The categories_list include is a listing helper for categories.
3 Usage:
4   1) assign the 'categories_list' variable to a valid array of tags.
5   2) include JB/categories_list
6   example:
7     <ul>
8           {% assign categories_list = site.categories %}  
9           {% include JB/categories_list %}
10         </ul>
11   
12   Notes: 
13     Categories can be either a Hash of Category objects (hashes) or an Array of category-names (strings).
14     The encapsulating 'if' statement checks whether categories_list is a Hash or Array.
15     site.categories is a Hash while page.categories is an array.
16     
17   This helper can be seen in use at: ../_layouts/default.html
18 -->{% endcomment %}
19
20 {% if site.JB.categories_list.provider == "custom" %}
21   {% include custom/categories_list %}
22 {% else %}
23   {% if categories_list.first[0] == null %}
24     {% for category in categories_list %} 
25         <li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category }}-ref">
26                 {{ category | join: "/" }} <span>{{ site.categories[category].size }}</span>
27         </a></li>
28     {% endfor %}
29   {% else %}
30     {% for category in categories_list %} 
31         <li><a href="{{ BASE_PATH }}{{ site.JB.categories_path }}#{{ category[0] }}-ref">
32                 {{ category[0] | join: "/" }} <span>{{ category[1].size }}</span>
33         </a></li>
34     {% endfor %}
35   {% endif %}
36 {% endif %}
37 {% assign categories_list = nil %}