[Hexo] Use hexo-related-popular-posts plugin to generates a list of links to related posts or popular posts in Hexo

hexo-related-popular-posts

Hexo is a fast, simple & powerful blog framework. It use plugins to provide features powerful APIs for limitless extensibility. Various plugins are available to support most template engines (EJS, Pug, Nunjucks, and many others). Easily integrate with existing NPM packages (Babel, PostCSS, Less/Sass, etc).

hexo-related-popular-posts plugin is a hexo plugin that generates a list of links to related posts or popular posts.

Installation

Use npm to install hexo-related-popular-posts package.

1
2
3
$ npm install hexo-related-popular-posts --save

$ hexo clean

Configuration

This plugin integrated in «NexT», you may adjust options in NexT config:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# _config.next.yml

# Related popular posts
# Dependencies: https://github.com/tea3/hexo-related-popular-posts
related_posts:
# DoItYourself
# enable: false
enable: true
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

Usage

If tags are included in the article, related articles can be displayed as a list. For example, add a tag like the following markdown file.

1
2
3
4
5
6
7
8
9
---
title: Hello World
tags:
- program
- diary
- web
---
Welcome to [Hexo](https://hexo.io/)! This is a sample article. Let's add some tags as above.
...

Finally, you can visit your site in the browser, and check whether the site works correctly after Hexo restarted or regenerated.

References

[1] GitHub - tea3/hexo-related-popular-posts: A hexo plugin that generates a list of links to related posts and popular posts. Also , this plugin can get Visitor Counts (PV) on posts. - https://github.com/tea3/hexo-related-popular-posts

[2] Hexo - https://hexo.io/