Add previous/next navigation to posts

This commit is contained in:
2016-01-30 23:03:15 +00:00
parent 9c52683d99
commit 239c9e066c
2 changed files with 14 additions and 1 deletions

View File

@@ -12,6 +12,19 @@
<a href="{{ page.code }}"><img alt="code" height="49" src="{{ site.static_prefix }}/icon/code.png" width="49" /></a> <a href="{{ page.code }}"><img alt="code" height="49" src="{{ site.static_prefix }}/icon/code.png" width="49" /></a>
{% endif %} {% endif %}
</div> </div>
<ul style="margin-top: 0;">
{% if page.previous %}
<li><a href="/{{ site.baseurl }}{{ page.previous.url }}" rel="prev">&nbsp;&larr;&nbsp;{{ page.previous.title }}&nbsp;</a></li>
{% else %}
<li><span class="noanchor">&nbsp;&larr;&nbsp;</span></li>
{% endif %}
{% if page.next %}
<li><a href="/{{ site.baseurl }}{{ page.next.url }}" rel="next">&nbsp;{{ page.next.title }}&nbsp;&rarr;&nbsp;</a></li>
{% else %}
<li><span class="noanchor">&nbsp;&rarr;&nbsp;</span></li>
{% endif %}
</ul>
<h1> <h1>
<span itemprop="name">{{ page.title }}</span> <span itemprop="name">{{ page.title }}</span>
<small class="print-only" itemprop="datePublished" content="{{ page.date|date:'%F') }}">{{ page.date|date:'%A, %B %d, %Y' }}</small> <small class="print-only" itemprop="datePublished" content="{{ page.date|date:'%F') }}">{{ page.date|date:'%A, %B %d, %Y' }}</small>