Navigation links in footer
authorGreg Wilson <gvwilson@third-bit.com>
Mon, 5 Sep 2016 17:51:02 +0000 (13:51 -0400)
committerGreg Wilson <gvwilson@third-bit.com>
Mon, 5 Sep 2016 17:51:02 +0000 (13:51 -0400)
_includes/episode_navbar.html [new file with mode: 0644]
_includes/lesson_footer.html
_includes/workshop_footer.html
_layouts/break.html
_layouts/episode.html

diff --git a/_includes/episode_navbar.html b/_includes/episode_navbar.html
new file mode 100644 (file)
index 0000000..082047f
--- /dev/null
@@ -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>
index 58d08fae539edd130bab6ab781996ab21ce35338..beef2cb38479f75cbf633044956afda873a837a5 100644 (file)
@@ -1,4 +1,3 @@
-<hr/>
 <footer>
   <div class="row">
     <div class="col-md-6" align="left">
index 1b94957cbbbe6d32781bd76a93a9daa508fd1df6..31e5f37f36c83c88ac522c3d77b7e1d8894af690 100644 (file)
@@ -1,4 +1,3 @@
-<hr/>
 <footer>
   <div class="row">
     <div class="col-md-6" align="left">
index 91e4532b1481523b3a367b727e17f47de8cac428..6e2a6a092f60e11ddda3ddd0cbb891a46db48b15 100644 (file)
@@ -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 %}
index 3776397a14ddb6b7a21f6253c538882a5f09964b..d774a6814733acd55e13a7d9c2ac132cd2a4eba8 100644 (file)
@@ -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 %}