initial commit with jekyll-boostrap
[openjpeg.git] / _includes / JB / pages_list
1 {% comment %}<!--
2 The pages_list include is a listing helper.
3 Usage:
4   1) assign the 'pages_list' variable to a valid array of pages or posts.
5   2) include JB/pages_list
6   example:
7     <ul>
8           {% assign pages_list = site.pages %}  
9           {% include JB/pages_list %}
10         </ul>
11         
12   Grouping: (optional): 
13         assign the 'group' variable to constrain the list to only pages/posts
14         in the given group. Note you must define the group manually in the page/post
15         meta-data to use this feature.
16         Grouping is mainly helpful for non-post pages.
17         If you want to group posts, it's easier/better to tag them, then pass the tagged posts array.
18         i.e. site.tags.cool_tag (this returns an array of posts tagged: cool_tag)
19         
20   This helper can be seen in use at: ../_layouts/default.html
21 -->{% endcomment %}
22
23 {% if site.JB.pages_list.provider == "custom" %}
24   {% include custom/pages_list %}
25 {% else %}
26   {% for node in pages_list %}
27     {% if node.title != null %}
28       {% if group == null or group == node.group %}
29         {% if page.url == node.url %}
30         <li class="active"><a href="{{ BASE_PATH }}{{node.url}}" class="active">{{node.title}}</a></li>
31         {% else %}
32         <li><a href="{{ BASE_PATH }}{{node.url}}">{{node.title}}</a></li>
33         {% endif %}
34       {% endif %}
35     {% endif %}
36   {% endfor %}
37 {% endif %}
38 {% assign pages_list = nil %}
39 {% assign group = nil %}