summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjeffreytse <jeffreytse.mail@gmail.com>2020-09-10 12:38:15 +0800
committerjeffreytse <jeffreytse.mail@gmail.com>2020-09-10 12:38:15 +0800
commit2f48f4b117be08c3511ebd8dd535ee5a0f433c5f (patch)
tree1845e0c93cb45a72d6d98a0a6cba7846f1622c56
parent283b912a9d52e7f66a2a9e0b99f10a927798cacf (diff)
fix: wrong relative url in post navigation
-rw-r--r--_layouts/post.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/_layouts/post.html b/_layouts/post.html
index 455e413..d1680a2 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -29,14 +29,14 @@ sidebar:
{%- if result.size == 0 -%}
<div class="post-nav">
{%- if page.previous -%}
- <a class="previous" href="{{ page.previous.url }}" title="{{
+ <a class="previous" href="{{ page.previous.url | relative_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 | truncatewords: 6 }}</a>
+ <a class="next" href="{{ page.next.url | relative_url }}" title="{{ page.next.title | escape }}">{{ page.next.title | escape | truncatewords: 6 }}</a>
{%- else -%}
<span></span>
{%- endif -%}
@@ -50,7 +50,7 @@ sidebar:
<ul>
{% assign posts = site[page.collection] | sample:4 %}
{%- for post in posts -%}
- <li><a class="post-link" href="{{post.url}}" title="{{ page.next.title | escape }}">{{ post.title | escape | truncatewords: 12 }}</a></li>
+ <li><a class="post-link" href="{{post.url | relative_url}}" title="{{ page.next.title | escape }}">{{ post.title | escape | truncatewords: 12 }}</a></li>
{%- endfor -%}
</ul>
</div>