]> git.arvados.org - rnaseq-cwl-training.git/blob - _includes/episode_title.html
Cleaning up prev/next logic
[rnaseq-cwl-training.git] / _includes / episode_title.html
1 {% comment %}
2   Find previous and next episodes (if any).
3 {% endcomment %}
4 {% for episode in site.episodes  %}
5   {% if episode.url == page.url %}
6     {% unless forloop.first %}
7       {% assign prev_episode = prev %}
8     {% endunless %}
9     {% unless forloop.last %}
10       {% assign next_episode = site.episodes[forloop.index] %}
11     {% endunless %}
12   {% endif %}
13   {% assign prev = episode %}
14 {% endfor %}
15
16 {% comment %}
17   Display title and prev/next links.
18 {% endcomment %}
19 <div class="row">
20   <div class="col-md-1">
21     <h3>
22       {% if prev_episode %}
23       <a href="{{ site.github.url }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
24       {% elsif site.github.url %}
25       <a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
26       {% else %}
27       <a href="/"><span class="glyphicon glyphicon-menu-up"></span></a>
28       {% endif %}
29     </h3>
30   </div>
31   <div class="col-md-10">
32     <h3 class="maintitle"><a href="{{ site.github.url }}/">{{ site.title }}</a></h3>
33     <h1 class="maintitle">{{ page.title }}</h1>
34   </div>
35   <div class="col-md-1">
36     <h3>
37       {% if next_episode %}
38       <a href="{{ site.github.url }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
39       {% elsif site.github.url %}
40       <a href="{{ site.github.url }}"><span class="glyphicon glyphicon-menu-up"></span></a>
41       {% else %}
42       <a href="/"><span class="glyphicon glyphicon-menu-up"></span></a>
43       {% endif %}
44     </h3>
45   </div>
46 </div>