项目作者: tea3

项目描述 :
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.
高级语言: JavaScript
项目地址: git://github.com/tea3/hexo-related-popular-posts.git
创建时间: 2016-07-29T10:53:45Z
项目社区:https://github.com/tea3/hexo-related-popular-posts

开源协议:MIT License

下载


hexo-related-popular-posts

Build Status Coverage Status NPM version

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

DEMO | Wiki | Documents | Releases(Update)

Screenshot

Requirements

If you are using an older hexo version, please use the follows version.
For example, if you using prior to hexo v5.0 now, please npm install hexo-related-popular-posts@4.2.0.

hexo version this plugin version
v3.2 or later 2.0.6
prior to v5.0 4.0.0

Overview


Installation

  1. $ npm install hexo-related-popular-posts --save

If you occur ERROR Plugin load failed: error or DTraceProviderBindings.node error , please see below.


Simply Usage

1. Edit your theme

First, add the following popular_posts( {} , post ) helper tag in template file for article. For example , if you use hexo-theme-landscape , add a tag here.

  1. <%-
  2. popular_posts( {} , post )
  3. %>

Variable name post is different depending on theme. Helper tag can set more option and customize the design . For detail , please see the wiki.

Also , if you occur Cannot read property 'tags' of undefined error , please refer to the follow as.

2. Add tags in markdown

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

The larger the number of matching tags, the more relevant articles are displayed as candidates. Otherside , advanced related posts and popular posts can be displayed. Please see the wiki .

3. Run server

Starts a local server. By default, this is at http://localhost:4000/.

  1. $ hexo clean
  2. $ hexo server

Thank you for introduction.

Thank you for a wonderful plugin.

License

MIT