File tree 1 file changed +5
-20
lines changed
1 file changed +5
-20
lines changed Original file line number Diff line number Diff line change 1
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.
2
+ Navigation bar for an episode.
18
3
{% endcomment %}
19
4
< div class ="row ">
20
5
< div class ="col-md-1 ">
21
6
< h3 >
22
- {% if prev_episode %}
23
- < a href ="{{ page.root }}{{ prev_episode .url }} "> < span class ="glyphicon glyphicon-menu-left " aria-hidden ="true "> </ span > < span class ="sr-only "> previous episode</ span > </ a >
7
+ {% if page.previous.url %}
8
+ < a href ="{{ page.root }}{{ page.previous .url }} "> < span class ="glyphicon glyphicon-menu-left " aria-hidden ="true "> </ span > < span class ="sr-only "> previous episode</ span > </ a >
24
9
{% else %}
25
10
< a href ="{{ page.root }}/ "> < span class ="glyphicon glyphicon-menu-up " aria-hidden ="true "> </ span > < span class ="sr-only "> lesson home</ span > </ a >
26
11
{% endif %}
@@ -34,8 +19,8 @@ <h1 class="maintitle">{{ page.title }}</h1>
34
19
</ div >
35
20
< div class ="col-md-1 ">
36
21
< h3 >
37
- {% if next_episode %}
38
- < a href ="{{ page.root }}{{ next_episode .url }} "> < span class ="glyphicon glyphicon-menu-right " aria-hidden ="true "> </ span > < span class ="sr-only "> next episode</ span > </ a >
22
+ {% if page.next.url %}
23
+ < a href ="{{ page.root }}{{ page.next .url }} "> < span class ="glyphicon glyphicon-menu-right " aria-hidden ="true "> </ span > < span class ="sr-only "> next episode</ span > </ a >
39
24
{% else %}
40
25
< a href ="{{ page.root }}/ "> < span class ="glyphicon glyphicon-menu-up " aria-hidden ="true "> </ span > < span class ="sr-only "> lesson home</ span > </ a >
41
26
{% endif %}
You can’t perform that action at this time.
0 commit comments