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