Skip to content

Commit

Permalink
Navigation links in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
gvwilson committed Sep 5, 2016
1 parent a688650 commit cf15546
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
45 changes: 45 additions & 0 deletions _includes/episode_navbar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% comment %}
Find previous and next episodes (if any).
Including file must pass episode_navbar_title=true or ...=false to display episode title.
{% endcomment %}
{% for episode in site.episodes %}
{% if episode.url == page.url %}
{% unless forloop.first %}
{% assign prev_episode = prev %}
{% endunless %}
{% unless forloop.last %}
{% assign next_episode = site.episodes[forloop.index] %}
{% endunless %}
{% endif %}
{% assign prev = episode %}
{% endfor %}

{% comment %}
Display title and prev/next links.
{% endcomment %}
<div class="row">
<div class="col-md-1">
<h3>
{% if prev_episode %}
<a href="{{ page.root }}{{ prev_episode.url }}"><span class="glyphicon glyphicon-menu-left"></span></a>
{% else %}
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up"></span></a>
{% endif %}
</h3>
</div>
<div class="col-md-10">
{% if include.episode_navbar_title %}
<h3 class="maintitle"><a href="{{ page.root }}/">{{ site.title }}</a></h3>
<h1 class="maintitle">{{ page.title }}</h1>
{% endif %}
</div>
<div class="col-md-1">
<h3>
{% if next_episode %}
<a href="{{ page.root }}{{ next_episode.url }}"><span class="glyphicon glyphicon-menu-right"></span></a>
{% else %}
<a href="{{ page.root }}/"><span class="glyphicon glyphicon-menu-up"></span></a>
{% endif %}
</h3>
</div>
</div>
1 change: 0 additions & 1 deletion _includes/lesson_footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<hr/>
<footer>
<div class="row">
<div class="col-md-6" align="left">
Expand Down
1 change: 0 additions & 1 deletion _includes/workshop_footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<hr/>
<footer>
<div class="row">
<div class="col-md-6" align="left">
Expand Down
3 changes: 2 additions & 1 deletion _layouts/break.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: base
---
{% include episode_title.html %}
{% include episode_navbar.html episode_navbar_title=true %}
{% include episode_break.html %}
{{content}}
{% include episode_navbar.html episode_navbar_title=false %}
3 changes: 2 additions & 1 deletion _layouts/episode.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
layout: base
---
{% include episode_title.html %}
{% include episode_navbar.html episode_navbar_title=true %}
{% include episode_overview.html %}
{{content}}
{% include episode_keypoints.html %}
{% include episode_navbar.html episode_navbar_title=false %}

0 comments on commit cf15546

Please sign in to comment.