|
2 | 2 | layout: default |
3 | 3 | --- |
4 | 4 |
|
| 5 | +{% assign sidebarItems = site.guide | sort: 'chapter' %} |
| 6 | + |
| 7 | +{% for item in sidebarItems %} |
| 8 | + {% if item.title == page.title %} |
| 9 | + {% unless forloop.first %} |
| 10 | + {% assign prevIndex = forloop.index| minus: 2 %} |
| 11 | + {% assign prev = sidebarItems[prevIndex] %} |
| 12 | + {% endunless %} |
| 13 | + {% unless forloop.last %} |
| 14 | + {% assign nextIndex = forloop.index %} |
| 15 | + {% assign next = sidebarItems[nextIndex] %} |
| 16 | + {% endunless %} |
| 17 | + {% endif %} |
| 18 | +{% endfor %} |
| 19 | + |
5 | 20 | <div class="d-md-flex flex-1"> |
6 | | - {% assign sidebarItems = site.guide | sort: 'chapter' %} {% include sidebar.html %} |
| 21 | + {% include sidebar.html %} |
7 | 22 |
|
8 | 23 | <section class="col-lg-9 px-5 f4"> |
9 | 24 | <div class="container-md markdown-body mb-5"> |
10 | 25 | <h1 class="mb-4 f0-light">{{ page.title }}</h1> |
11 | 26 | {{ content }} |
12 | | - <div class="mt-4 Box"> |
13 | | - <nav class="paginate-container Box-body" aria-label="Pagination"> |
14 | | - <div class="pagination"> |
15 | | - {% if page.previous %} |
16 | | - <span class="previous_page" aria-disabled="true">Previous</span> |
17 | | - {% else %} |
18 | | - <a class="previous_page" rel="previous" href="{{page.previous.url}}" aria-label="Previous Page">Previous</a> |
19 | | - {% endif %} {% if page.next %} |
20 | | - <span class="next_page" aria-disabled="true">Next</span> |
21 | | - {% else %} |
22 | | - <a class="next_page" rel="next" href="{{page.next.url}}" aria-label="Next Page">Next</a> |
23 | | - {% endif %} |
24 | | - </div> |
| 27 | + <div class="mt-4"> |
| 28 | + <nav class="prev-next-links" aria-label="Pagination"> |
| 29 | + {% if prev %} |
| 30 | + <a class="prev-next-links__button" rel="previous" href="{{prev.url}}" aria-label="Previous Page"> |
| 31 | + <div class="f6 text-uppercase">Previous</div> |
| 32 | + {{prev.title}} |
| 33 | + </a> |
| 34 | + {% endif %} {% if next %} |
| 35 | + <a class="prev-next-links__button" rel="next" href="{{next.url}}" aria-label="Next Page"> |
| 36 | + <div class="f6 text-uppercase">Next</div> |
| 37 | + {{next.title}} |
| 38 | + </a> |
| 39 | + {% endif %} |
25 | 40 | </nav> |
26 | 41 | </div> |
27 | 42 | </div> |
|
0 commit comments