diff --git a/_includes/episode_navbar.html b/_includes/episode_navbar.html index a789d3d9..1f6e033d 100644 --- a/_includes/episode_navbar.html +++ b/_includes/episode_navbar.html @@ -1,26 +1,11 @@ {% comment %} - Find previous and next episodes (if any). -{% 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. + Navigation bar for an episode. {% endcomment %}

- {% if prev_episode %} - previous episode + {% if page.previous.url %} + previous episode {% else %} lesson home {% endif %} @@ -34,8 +19,8 @@

{{ page.title }}

- {% if next_episode %} - next episode + {% if page.next.url %} + next episode {% else %} lesson home {% endif %}