mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Replace hexo-related-popular-posts with hexo-related-posts (#447)
This commit is contained in:
parent
2094a764d6
commit
07bd564401
@ -273,17 +273,11 @@ follow_me:
|
||||
#RSS: /atom.xml || fa fa-rss
|
||||
|
||||
# Related popular posts
|
||||
# Dependencies: https://github.com/tea3/hexo-related-popular-posts
|
||||
# Dependencies: https://github.com/sergeyzwezdin/hexo-related-posts
|
||||
related_posts:
|
||||
enable: false
|
||||
title: # Custom header, leave empty to use the default one
|
||||
display_in_home: false
|
||||
params:
|
||||
maxCount: 5
|
||||
#PPMixingRate: 0.0
|
||||
#isDate: false
|
||||
#isImage: false
|
||||
#isExcerpt: false
|
||||
|
||||
# Post edit
|
||||
# Easily browse and edit blog source code online.
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
{%- set popular_posts = popular_posts_json(theme.related_posts.params, page) %}
|
||||
{%- if popular_posts.json and popular_posts.json.length > 0 %}
|
||||
{%- if page.related_posts and page.related_posts.length > 0 %}
|
||||
<div class="popular-posts-header">{{ theme.related_posts.title or __('post.related_posts') }}</div>
|
||||
<ul class="popular-posts">
|
||||
{%- for popular_post in popular_posts.json %}
|
||||
{%- for path in page.related_posts %}
|
||||
{%- set popular_post = site.posts.findOne({ path: path }) %}
|
||||
<li class="popular-posts-item">
|
||||
{%- if popular_post.date and popular_post.date != '' %}
|
||||
<div class="popular-posts-date">{{ popular_post.date }}</div>
|
||||
{%- if popular_post.date %}
|
||||
<div class="popular-posts-date">{{ date(popular_post.date) }}</div>
|
||||
{%- endif %}
|
||||
{%- if popular_post.img and popular_post.img != '' %}
|
||||
{%- if popular_post.img %}
|
||||
<div class="popular-posts-img"><img src="{{ popular_post.img }}" alt="{{ popular_post.title }}"></div>
|
||||
{%- endif %}
|
||||
<div class="popular-posts-title"><a href="{{ popular_post.path }}" rel="bookmark">{{ popular_post.title }}</a></div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user