From 6c03d3d63345da8aeaa08a0159d02c180ba341a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=8D=C9=AA=E1=B4=8D=C9=AA?= <1119186082@qq.com> Date: Thu, 8 Aug 2019 00:39:17 +0800 Subject: [PATCH] Optimize the rendering of posts (#1075) --- layout/_macro/post.swig | 153 +++++++----------- layout/_partials/post/post-copyright.swig | 2 + layout/_partials/post/post-footer.swig | 50 ++++++ .../post/{reward.swig => post-reward.swig} | 0 layout/_partials/share/index.swig | 3 + layout/_partials/share/likely.swig | 13 -- 6 files changed, 110 insertions(+), 111 deletions(-) create mode 100644 layout/_partials/post/post-footer.swig rename layout/_partials/post/{reward.swig => post-reward.swig} (100%) diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 106bc89200..e5987ece10 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -261,6 +261,10 @@ {%- endif %} + {#####################} + {### END POST BODY ###} + {#####################} + {%- if theme.related_posts.enable and (theme.related_posts.display_in_home or not is_index) %} {% include '../_partials/post/post-related.swig' with { post: post } %} {%- endif %} @@ -269,117 +273,70 @@ {%- for inject_item in theme.injects.postBodyEnd %} {{ partial(inject_item.layout, inject_item.locals, inject_item.options) }} {%- endfor %} - {%- endif %} - - {#####################} - {### END POST BODY ###} - {#####################} - {%- if theme.wechat_subscriber.enable and not is_index %} - {% include '../_partials/post/wechat-subscriber.swig' %} - {%- endif %} + {%- if theme.wechat_subscriber.enable %} + {{ partial('../_partials/post/wechat-subscriber.swig', {}, {cache: theme.cache.enable}) }} + {%- endif %} - {%- if post.reward === undefined and theme.reward_settings.enable %} - {%- set reward_able = true %} - {% else %} - {%- set reward_able = post.reward %} - {%- endif %} - {%- if reward_able and not is_index %} -