~xdavidwu/xdavidwu.link

58662946cd7622c57097caa2f2c1ea7367d944d8 — Michael Rose 8 years ago 4548f70
Only show post pagination if there are previous or next posts
1 files changed, 14 insertions(+), 12 deletions(-)

M _includes/post_pagination.html
M _includes/post_pagination.html => _includes/post_pagination.html +14 -12
@@ 1,12 1,14 @@
<nav class="pagination">
  {% if page.previous %}
    <a href="{{ base_path }}{{ page.previous.url }}" class="pagination--pager" title="{{ page.previous.title | markdownify | strip_html }}">{{ site.data.ui-text[site.locale].pagination_previous }}</a>
  {% else %}
    <a href="#" class="pagination--pager disabled">{{ site.data.ui-text[site.locale].pagination_previous }}</a>
  {% endif %}
  {% if page.next %}
    <a href="{{ base_path }}{{ page.next.url }}" class="pagination--pager" title="{{ page.next.title | markdownify | strip_html }}">{{ site.data.ui-text[site.locale].pagination_next }}</a>
  {% else %}
    <a href="#" class="pagination--pager disabled">{{ site.data.ui-text[site.locale].pagination_next }}</a>
  {% endif %}
</nav>
\ No newline at end of file
{% if page.previous or page.next %}
  <nav class="pagination">
    {% if page.previous %}
      <a href="{{ base_path }}{{ page.previous.url }}" class="pagination--pager" title="{{ page.previous.title | markdownify | strip_html }}">{{ site.data.ui-text[site.locale].pagination_previous }}</a>
    {% else %}
      <a href="#" class="pagination--pager disabled">{{ site.data.ui-text[site.locale].pagination_previous }}</a>
    {% endif %}
    {% if page.next %}
      <a href="{{ base_path }}{{ page.next.url }}" class="pagination--pager" title="{{ page.next.title | markdownify | strip_html }}">{{ site.data.ui-text[site.locale].pagination_next }}</a>
    {% else %}
      <a href="#" class="pagination--pager disabled">{{ site.data.ui-text[site.locale].pagination_next }}</a>
    {% endif %}
  </nav>
{% endif %}
\ No newline at end of file