From e8faeb3a62757688d592e1a7290806023f4331f8 Mon Sep 17 00:00:00 2001 From: Hui Wang Date: Mon, 25 Dec 2017 14:37:29 +0100 Subject: [PATCH 1/2] recommended posts --- _config.yml | 4 ++++ languages/en.yml | 1 + languages/fr-FR.yml | 1 + languages/zh-Hans.yml | 1 + layout/_macro/post.swig | 6 ++++++ layout/_macro/recommended_posts.swig | 11 +++++++++++ 6 files changed, 24 insertions(+) create mode 100644 layout/_macro/recommended_posts.swig diff --git a/_config.yml b/_config.yml index f57c58bd2..2a4aa4f85 100755 --- a/_config.yml +++ b/_config.yml @@ -227,6 +227,10 @@ post_wordcount: totalcount: false separated_meta: true +# Recommended posts +recommended_posts: + enabled: true + # Wechat Subscriber #wechat_subscriber: #enabled: true diff --git a/languages/en.yml b/languages/en.yml index 37fe1dbc6..90fc73e9f 100644 --- a/languages/en.yml +++ b/languages/en.yml @@ -41,6 +41,7 @@ post: license_title: Copyright Notice license_content: 'All articles in this blog are licensed under %s unless stating additionally.' + recommended_posts: Recommended Posts page: totally: Totally diff --git a/languages/fr-FR.yml b/languages/fr-FR.yml index 6a3d2aed1..0374013a8 100644 --- a/languages/fr-FR.yml +++ b/languages/fr-FR.yml @@ -35,6 +35,7 @@ post: license_title: Copyright Notice license_content: 'All articles in this blog are licensed under %s unless stating additionally.' + recommended_posts: articles Recommandées page: totally: Total diff --git a/languages/zh-Hans.yml b/languages/zh-Hans.yml index 1159864fb..e4c0a647d 100644 --- a/languages/zh-Hans.yml +++ b/languages/zh-Hans.yml @@ -40,6 +40,7 @@ post: license_title: 版权声明 license_content: '本博客所有文章除特别声明外,均采用 %s 许可协议。转载请注明出处!' + recommended_posts: 推荐文章 page: totally: 共有 diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 12a6d583e..11aa8f7f7 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -334,6 +334,12 @@ {### END POST BODY ###} {#####################} + {% if theme.recommended_posts.enabled and not is_index %} +
+ {% include 'recommended_posts.swig' with {post: post, site: site} %} +
+ {% endif %} + {% if theme.wechat_subscriber.enabled and not is_index %}
{% include 'wechat-subscriber.swig' %} diff --git a/layout/_macro/recommended_posts.swig b/layout/_macro/recommended_posts.swig new file mode 100644 index 000000000..6e56e89c6 --- /dev/null +++ b/layout/_macro/recommended_posts.swig @@ -0,0 +1,11 @@ + \ No newline at end of file From f61f479b306298809ac800431f80e31237c3ce8b Mon Sep 17 00:00:00 2001 From: hwang Date: Wed, 27 Dec 2017 11:21:20 +0100 Subject: [PATCH 2/2] disable recommended post by default, add dependency on the recommended-posts plugin --- _config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 2a4aa4f85..4782f4b30 100755 --- a/_config.yml +++ b/_config.yml @@ -228,8 +228,9 @@ post_wordcount: separated_meta: true # Recommended posts +# Dependency: https://github.com/huiwang/hexo-recommended-posts recommended_posts: - enabled: true + enabled: false # Wechat Subscriber #wechat_subscriber: