https://github.com/situ2001/hexo-page-share
Generate QR code for the articles of your hexo blog.
https://github.com/situ2001/hexo-page-share
Last synced: 8 months ago
JSON representation
Generate QR code for the articles of your hexo blog.
- Host: GitHub
- URL: https://github.com/situ2001/hexo-page-share
- Owner: situ2001
- Created: 2021-05-07T00:59:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-11T09:09:36.000Z (over 4 years ago)
- Last Synced: 2025-02-08T17:02:37.011Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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');
});```