Improve doc 'previous-next' view
Signed-off-by: trivernis <trivernis@protonmail.com>gh-pages
parent
7d9c535f1d
commit
f4086ac0f8
@ -0,0 +1,7 @@
|
||||
---
|
||||
layout: doc
|
||||
title: Tagging
|
||||
sort_index: 40
|
||||
draft: true
|
||||
---
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
layout: doc
|
||||
title: Repository Configuration
|
||||
sort_key: 1
|
||||
sort_index: 50
|
||||
draft: true
|
||||
---
|
||||
|
||||
|
@ -0,0 +1,29 @@
|
||||
<!-- Use if you want to show previous and next for posts within a category. -->
|
||||
{% assign posts = site.docs | sort: "sort_index" %}
|
||||
{% for post in posts %}
|
||||
{% if post.sort_index < page.sort_index %}
|
||||
{% assign prev_post = post %}
|
||||
{% endif %}
|
||||
{% if post.sort_index > page.sort_index %}
|
||||
{% assign next_post = post %}
|
||||
{% break %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% assign user_url = site.url | append: site.baseurl %}
|
||||
{% assign full_base_url = user_url | default: site.github.url %}
|
||||
{% if prev_post and prev_post.draft == false %}
|
||||
<div class="col-4 sm-width-full left mr-lg-4 mt-3">
|
||||
<a class="no-underline border-top-thin py-1 block" href="{{ prev_post.url | prepend: full_base_url }}">
|
||||
<span class="h5 bold text-accent">Previous</span>
|
||||
<p class="bold h3 link-primary mb-1">{{ prev_post.title }}</p>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if next_post and next_post.draft == false %}
|
||||
<div class="col-4 sm-width-full left mt-3">
|
||||
<a class="no-underline border-top-thin py-1 block" href="{{ next_post.url | prepend: full_base_url }}">
|
||||
<span class="h5 bold text-accent">Next</span>
|
||||
<p class="bold h3 link-primary mb-1">{{ next_post.title }}</p>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
Loading…
Reference in New Issue