# hexo-page-share

> This is a simple hexo plugin used to generating QR code of URL of the current page.

Latest version **1.0.3** (published 2021-05-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install hexo-page-share
pnpm add hexo-page-share
yarn add hexo-page-share
bun add hexo-page-share
```

## 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 | 1.0.3 |
| Published | 2021-05-11 |
| First published | 2021-05-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | situ2001 |
| Maintainers | situ2001 |

## Links

- npm: https://www.npmjs.com/package/hexo-page-share
- Repository: https://github.com/situ2001/hexo-page-share
- Homepage: https://github.com/situ2001/hexo-page-share#readme
- Issues: https://github.com/situ2001/hexo-page-share/issues
- npm.io page: https://npm.io/package/hexo-page-share

## Dependencies (2)

- [yaqrcode](https://npm.io/package/yaqrcode.md) ^0.2.1
- [hexo-util](https://npm.io/package/hexo-util.md) ^2.5.0

## Recent versions

- 1.0.3 (latest) — 2021-05-11
- 1.0.2 — 2021-05-07
- 1.0.1 — 2021-05-07
- 1.0.0 — 2021-05-07

## README

# Hexo-page-share

This is a simple hexo plugin used to generating QR code of URL of the current page.

## Setup

Install to your hexo blog folder.

```powershell
yarn add hexo-page-share
```

Add a statement to your `ejs` or `njk` template, so that the QR code can be correctly rendered when you run `hexo g`.

If you use `ejs` as the template format of your theme. You may add this statement to the corresponding place where you want the site to show the QR code.

```ejs
<%- renderShare() %>
```

Or if you use `njk`.

```njk
{{ renderShare() }}
```

## How to use in hexo-theme-next

A simple way(not the best) to apply this plugin to **hexo-theme-next** is to add injection to this theme.

Create file `share` in folder `source/_data` then add the following statement.

```njk
{{ renderShare() }}
```

Create `share.js` in folder `scripts`, if the folder does not exist, newly create one.

Then add these codes to `share.js`

```javascript
/* global hexo */
'use strict';

hexo.extend.filter.register('theme_inject', injects => {
  injects.postBodyEnd.file('share', 'source/_data/share');
});

```

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