Skip to content

A hexo plugin that generates a list of related posts on The Theme Next.

License

Notifications You must be signed in to change notification settings

jixiaod/hexo-next-list-related-posts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

hexo-next-list-related-posts

A hexo plugin that generates a list of related posts on The Theme Next.

Demo

http://blog.100dos.com/2017/04/07/php-garbage-collection-collect-cycles/

Install

$ npm install hexo-next-list-related-posts --save

Usage

In file themes/next/layout/_macro/post.swig, Add

      {% set related_post =  list_related_posts(post, {maxCount: 10, orderBy: 'date'}) %}
      {% if related_post.length > 0 %}
        <h3 class="article-title" style="font-size: 20px;">相关文章</h3>
        <ul class="related-posts">
        {% for rl_post in related_post %}
            <li class="related-posts-item"><a href="{{ url_for(rl_post.path) }}">{{ rl_post.title }}</a></li>
        {% endfor %}
        </ul>
      {% endif %}

About

A hexo plugin that generates a list of related posts on The Theme Next.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published