# 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 (PageView) on posts.

Latest version **5.0.1** (published 2020-08-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install hexo-related-popular-posts
pnpm add hexo-related-popular-posts
yarn add hexo-related-popular-posts
bun add hexo-related-popular-posts
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 5.0.1 |
| Published | 2020-08-29 |
| First published | 2016-07-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.10.0 |
| Dependencies | 9 |
| Unpacked size | 74.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 115 |
| Author | tea3 |
| Maintainers | tea3gt |
| Keywords | popularPosts, relatedPosts, similarPosts, staticSiteGenerator, hexo, blog, MorphologicalAnalysis, node.js, list, helper, visitorCounts, pageViews, pv |

## Links

- npm: https://www.npmjs.com/package/hexo-related-popular-posts
- Repository: https://github.com/tea3/hexo-related-popular-posts
- Homepage: https://github.com/tea3/hexo-related-popular-posts#readme
- Issues: https://github.com/tea3/hexo-related-popular-posts/issues
- npm.io page: https://npm.io/package/hexo-related-popular-posts

## Dependencies (9)

- [hasha](https://npm.io/package/hasha.md) ^3.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [moment](https://npm.io/package/moment.md) ^2.19.1
- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.2
- [hexo-fs](https://npm.io/package/hexo-fs.md) ^0.2.2
- [kuromoji](https://npm.io/package/kuromoji.md) ^0.1.1
- [log-util](https://npm.io/package/log-util.md) ^1.2.0
- [columnify](https://npm.io/package/columnify.md) ^1.5.4
- [ga-analytics](https://npm.io/package/ga-analytics.md) ^0.0.7

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 5.0.1 (latest) — 2020-08-29
- 5.0.0 — 2020-08-05
- 4.0.0 — 2019-12-25
- 3.0.6 — 2019-05-27
- 3.0.5 — 2019-04-25
- 3.0.4 — 2019-04-18
- 3.0.3 — 2018-10-30
- 3.0.2 — 2018-10-25
- 3.0.1 — 2018-01-26
- 3.0.0 — 2017-12-20
- 2.0.6 — 2017-11-23
- 2.0.5 — 2017-11-14
- 2.0.4 — 2017-10-27
- 2.0.3 — 2017-10-06
- 2.0.2 — 2017-09-08
- … 15 more at https://npm.io/package/hexo-related-popular-posts/versions

## README

# hexo-related-popular-posts

[![Build Status](https://travis-ci.org/tea3/hexo-related-popular-posts.svg?branch=master)](https://travis-ci.org/tea3/hexo-related-popular-posts) [![Coverage Status](https://img.shields.io/coveralls/tea3/hexo-related-popular-posts.svg)](https://coveralls.io/r/tea3/hexo-related-popular-posts?branch=master) [![NPM version](https://badge.fury.io/js/hexo-related-popular-posts.svg)](http://badge.fury.io/js/hexo-related-popular-posts)

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

[DEMO](https://photo-tea.com/p/tea-plantation-mtfuji/#relatedPosts) | [Wiki](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings) | [Documents](https://photo-tea.com/p/hexo-related-popular-posts/) | [Releases(Update)](https://github.com/tea3/hexo-related-popular-posts/releases)

![Screenshot](src/img/hexo-rpp.png)

### 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

- Generate [related list of posts](#simply-usage).

    Sort and extracted by [relevance of tags](#simply-usage) and [word relevance of contents](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#advanced-related-posts-morphological-analysis).

- Generate [popular list of posts](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#popular-posts).

    Sort and extract in Google Analytics page view.

- Generate [Page Views information](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#visitor-counter) in posts.

    Gets and displays the Google Analytics page view.

- Flexible customizable [option](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#hepler) and [design](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#customize-html)
- [Improve production speed](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#cache)

---


## Installation

``` bash
$ npm install hexo-related-popular-posts --save
```

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

- [ISSUE_TEMPLATE](https://github.com/tea3/hexo-related-popular-posts/blob/master/.github/ISSUE_TEMPLATE.md)
- [DTraceProviderBindings.node issue #1](https://github.com/tea3/hexo-related-popular-posts/issues/1)

---

## 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](https://github.com/hexojs/hexo-theme-landscape) , add a tag [here](https://github.com/hexojs/hexo-theme-landscape/blob/master/layout/_partial/article.ejs#L25).

``` ejs
  <%-
    popular_posts( {} , post )
  %>
```

Variable name `post` is different depending on theme. Helper tag can set [more option](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#hepler) and [customize the design](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#customize-html) . For detail , please see the wiki.

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

- [Swig (e.g. hexo-theme-next)](https://github.com/tea3/hexo-related-popular-posts/issues/4)
- [Ejs (e.g. hexo-theme-phantom)](https://github.com/tea3/hexo-related-popular-posts/issues/6)

### 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.

```
---
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.
...
```

The larger the number of matching tags, the more relevant articles are displayed as candidates. Otherside , [advanced related posts](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#advanced-related-posts-morphological-analysis) and [popular posts](https://github.com/tea3/hexo-related-popular-posts/wiki/More-Settings#popular-posts) can be displayed. Please see the wiki .

### 3. Run server

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

``` bash
$ hexo clean
$ hexo server
```


---

## Thank you for introduction.

- [Plugins hexo-related-popular-posts 설정하기 - MSFL::모리스 소프트웨어 공작소, IT Blog](http://ccambo.gitlab.io/2017/04/19/Plugins-hexo-related-popular-posts-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0/)
- [サイトをカスタマイズしました : タグクラウドプラグイン & 関連記事表示プラグインの導入 & 一部シェアボタン追加 - YoshinoriN's Memento](https://yoshinorin.net/2016/11/03/hexo-blog-customize/)
- [HEXOをカスタマイズしました(関連記事プラグイン導入とか)">HEXOをカスタマイズしました(関連記事プラグイン導入とか) - 可愛いを叫ぶブログ](http://8hagi.sakura.ne.jp/sblog/2017/02/11/hexo-related-post/)
- [Hexo に 関連する記事のリストを追加する - Azriton's blog](https://azriton.github.io/2017/06/16/Hexo%E3%81%AB%E9%96%A2%E9%80%A3%E3%81%99%E3%82%8B%E8%A8%98%E4%BA%8B%E3%81%AE%E3%83%AA%E3%82%B9%E3%83%88%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B/)

## Thank you for a wonderful plugin.

- Hexo : [http://hexo.io/](http://hexo.io/)
- ga-analytics : [https://github.com/sfarthin/ga-analytics](https://github.com/sfarthin/ga-analytics)
- kuromoji.js : [https://github.com/takuyaa/kuromoji.js](https://github.com/takuyaa/kuromoji.js)

## License

MIT

---
_Source: https://npm.io/package/hexo-related-popular-posts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
