From 14172486dfb480aa80d467592963f57cc0bb734d Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Fri, 22 Nov 2019 17:53:41 +0800 Subject: [PATCH] Add post navigation display configuration --- _config.yml | 4 ++ layout/_macro/post.swig | 22 +-------- scripts/helpers/engine.js | 20 ++++++++ .../css/_common/components/post/post-nav.styl | 48 +++++++++---------- source/css/_schemes/Gemini/index.styl | 9 ---- 5 files changed, 48 insertions(+), 55 deletions(-) diff --git a/_config.yml b/_config.yml index f625ff08d7..cd96c1b3de 100644 --- a/_config.yml +++ b/_config.yml @@ -305,6 +305,10 @@ post_edit: url: https://github.com/user-name/repo-name/tree/branch-name/subdirectory-name # Link for view source #url: https://github.com/user-name/repo-name/edit/branch-name/subdirectory-name # Link for fork & edit +# Show previous post and next post in post footer if exists +# Available values: left | right | false +post_navigation: left + # --------------------------------------------------------------- # Custom Page Settings diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 18dce24aa0..21148b4a97 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -250,27 +250,7 @@ {{ partial('_partials/post/post-footer.swig', {}, {cache: theme.cache.enable}) }} - {%- if post.prev or post.next %} -
-
- {%- if post.next %} - - {%- endif %} -
- - - -
- {%- if post.prev %} - - {%- endif %} -
-
- {%- endif %} + {{ post_nav(post) }} {% else %}