summaryrefslogtreecommitdiff
path: root/_layouts
diff options
context:
space:
mode:
authorjeffreytse <jeffreytse.mail@gmail.com>2020-07-16 12:10:42 +0800
committerjeffreytse <jeffreytse.mail@gmail.com>2020-07-16 12:10:42 +0800
commitbf7c0b1c505364582c030ffb14b3b3827e999da8 (patch)
treee1a7a6432ff7d8d4f607c79117c980c7dd59268d /_layouts
parentd45f20b404899e4f4d4e9a2c005fd951589b5499 (diff)
feat: truncate words for post page footer nav
Diffstat (limited to '_layouts')
-rw-r--r--_layouts/post.html7
1 files changed, 5 insertions, 2 deletions
diff --git a/_layouts/post.html b/_layouts/post.html
index 9195f13..364b76c 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -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 -%}