A hexo plugin that generates a list of links to related posts based on tags.
List is ordered by the number of matched tags.
$ npm install hexo-list-related-posts --save
Add <%- list_related_posts([options]) %>
in template file for article.
option | description | default |
---|---|---|
maxCount | Maximum count of a list | 5 |
ulClass | Class name of ul | 'related-posts' |
liClass | Class name of li | 'related-posts-item' |
orderBy | 'date' or 'random' When the number of matched tags is the same, list is ordered by date or random. |
'date' |
isAscending | Ascending or descending when list is ordered by date. | false |
<%- list_related_posts({maxCount: 10, orderBy: 'random'}) %>