<nav class="section-nav text-center">
    {% if page.prev_section != null %}
      <a href="{{ site.url }}{% if page.lang %}/{{ page.lang }}{% endif %}/{{page.chapter}}/{{ page.prev_section }}/"
         class="btn btn-prev btn-primary" title="{{ page.prev_section | capitalize  }}">
       Back
      </a>
    {% else %}
      <a class="btn btn-prev prev disabled">Back</a>
    {% endif %}

    {% if page.next_section != null %}
      <a href="{{ site.url }}{% if page.lang %}/{{ page.lang }}{% endif %}/{{page.chapter}}/{{ page.next_section }}/"
         class="btn btn-next btn-primary" title="{{ page.next_section | capitalize }}">
        Next
      </a>
    {% else %}
      <a class="btn btn-next next disabled">Next</a>
    {% endif %}
</nav>
<nav class="section-nav text-center">
    {% if page.prev_section != null %}
      <a href="{{ site.url }}{% if page.lang %}/{{ page.lang }}{% endif %}/{{page.chapter}}/{% if page.chapter != page.prev_section %}{{ page.prev_section }}/{% endif %}"
         class="btn btn-prev btn-primary" title="{{ page.prev_section | capitalize  }}">
       Back
      </a>
    {% else %}
      <a class="btn btn-prev prev disabled">Back</a>
    {% endif %}

    {% if page.next_section != null %}
      <a href="{{ site.url }}{% if page.lang %}/{{ page.lang }}{% endif %}/{{page.chapter}}/{{ page.next_section }}/"
         class="btn btn-next btn-primary" title="{{ page.next_section | capitalize }}">
        Next
      </a>
    {% else %}
      <a class="btn btn-next next disabled">Next</a>
    {% endif %}
</nav>

Fix back button to index page
Fix back button to index page

closes #1278
