From f935e61b3cdcf75ec1be401209b5cc3bbf72d88b Mon Sep 17 00:00:00 2001
From: StevenJoeZhang <1119186082@qq.com>
Date: Sat, 8 Dec 2018 21:18:30 +0800
Subject: [PATCH] bug fix
---
layout/_macro/post-collapse.swig | 3 ++-
layout/_macro/post.swig | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/layout/_macro/post-collapse.swig b/layout/_macro/post-collapse.swig
index 73e5904bbb..f4b4c3076b 100644
--- a/layout/_macro/post-collapse.swig
+++ b/layout/_macro/post-collapse.swig
@@ -6,7 +6,8 @@
<{% if theme.seo %}h3{% else %}h2{% endif %} class="post-title">
{% if post.link %}{# Link posts #}
{% set postTitleIcon = '' %}
- {{ next_url(url_for(post.link), (post.title or post.link) + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url' }) }}
+ {% set postText = post.title or post.link %}
+ {{ next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url' }) }}
{% else %}
{% if post.type === 'picture' %}
diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig
index d8e400a6fc..a2e9d1c4fe 100644
--- a/layout/_macro/post.swig
+++ b/layout/_macro/post.swig
@@ -46,7 +46,8 @@
{% endif %}
{% set postTitleIcon = '' %}
- {{ next_url(url_for(post.link), (post.title or post.link) + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url' }) }}
+ {% set postText = post.title or post.link %}
+ {{ next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url' }) }}
{% else %}{#
#}{% if is_index %}
{% if post.sticky > 0 %}
@@ -55,7 +56,7 @@
{% endif %}
{# Need to delete maybe? #}
- {{ next_url(url_for(post.path), post.title | default(__('post.untitled')), {class: 'post-title-link', itemprop: url }) }}
+ {{ next_url(post.path, post.title | default(__('post.untitled')), {class: 'post-title-link', itemprop: url }) }}
{% else -%}
{{- post.title -}}
{% if theme.post_edit.enable -%}