feat: truncate words for post page footer nav

This commit is contained in:
jeffreytse 2020-07-16 12:10:42 +08:00
parent d45f20b404
commit bf7c0b1c50

View file

@ -21,13 +21,16 @@ sidebar:
<div class="post-nav">
{%- if page.previous -%}
<a class="previous" href="{{ page.previous.url }}" title="{{ page.previous.title | escape }}">{{ page.previous.title | escape }}</a>
<a class="previous" href="{{ page.previous.url }}" title="{{
page.previous.title | escape }}">{{ page.previous.title | escape |
truncatewords: 6 }}</a>
{%- else -%}
<span></span>
{%- endif -%}
{%- if page.next -%}
<a class="next" href="{{ page.next.url }}" title="{{ page.next.title | escape }}">{{ page.next.title | escape }}</a>
<a class="next" href="{{ page.next.url }}" title="{{ page.next.title |
escape }}">{{ page.next.title | escape | truncatewords: 6 }}</a>
{%- else -%}
<span></span>
{%- endif -%}