Skip to content

Commit cf15546

Browse files
committed
Navigation links in footer
1 parent a688650 commit cf15546

File tree

5 files changed

+49
-4
lines changed

5 files changed

+49
-4
lines changed

_includes/episode_navbar.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{% comment %}
2+
Find previous and next episodes (if any).
3+
Including file must pass episode_navbar_title=true or ...=false to display episode title.
4+
{% endcomment %}
5+
{% for episode in site.episodes %}
6+
{% if episode.url == page.url %}
7+
{% unless forloop.first %}
8+
{% assign prev_episode = prev %}
9+
{% endunless %}
10+
{% unless forloop.last %}
11+
{% assign next_episode = site.episodes[forloop.index] %}
12+
{% endunless %}
13+
{% endif %}
14+
{% assign prev = episode %}
15+
{% endfor %}
16+
17+
{% comment %}
18+
Display title and prev/next links.
19+
{% endcomment %}
20+
<div class="row">
21+
<div class="col-md-1">
22+
<h3>
23+
{% if prev_episode %}
24+
<a href="{{ page.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
25+
{% else %}
26+
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up"></span></a>
27+
{% endif %}
28+
</h3>
29+
</div>
30+
<div class="col-md-10">
31+
{% if include.episode_navbar_title %}
32+
<h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
33+
<h1 class="maintitle">{{ page.title }}</h1>
34+
{% endif %}
35+
</div>
36+
<div class="col-md-1">
37+
<h3>
38+
{% if next_episode %}
39+
<a href="{{ page.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
40+
{% else %}
41+
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up"></span></a>
42+
{% endif %}
43+
</h3>
44+
</div>
45+
</div>

_includes/lesson_footer.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<hr/>
21
<footer>
32
<div class="row">
43
<div class="col-md-6" align="left">

_includes/workshop_footer.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
<hr/>
21
<footer>
32
<div class="row">
43
<div class="col-md-6" align="left">

_layouts/break.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
layout: base
33
---
4-
{% include episode_title.html %}
4+
{% include episode_navbar.html episode_navbar_title=true %}
55
{% include episode_break.html %}
66
{{content}}
7+
{% include episode_navbar.html episode_navbar_title=false %}

_layouts/episode.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
layout: base
33
---
4-
{% include episode_title.html %}
4+
{% include episode_navbar.html episode_navbar_title=true %}
55
{% include episode_overview.html %}
66
{{content}}
77
{% include episode_keypoints.html %}
8+
{% include episode_navbar.html episode_navbar_title=false %}

0 commit comments

Comments
 (0)