From 982fe2bbadb814732d626682e519fb9df22f51a8 Mon Sep 17 00:00:00 2001 From: Hans362 Date: Tue, 16 Feb 2021 16:15:14 +0800 Subject: [PATCH] :memo: Update README.md --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++++- index.js | 4 ++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cdd2897..e8acac3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,44 @@ # hexo-tag-bangumi -📺Embed Bilibili bangumi progress in Hexo posts or pages + +> 📺 Embed Bilibili bangumi progress in Hexo posts or pages + +[![](https://img.shields.io/npm/v/hexo-tag-bilibili-bangumi.svg?style=flat-square)](https://www.npmjs.com/package/hexo-tag-bilibili-bangumi) +[![](https://img.shields.io/badge/Author-Hans362-blue.svg?style=flat-square)](https://hans362.cn) +[![](https://img.shields.io/npm/l/hexo-tag-bilibili-bangumi.svg?style=flat-square)](https://github.com/hans362/hexo-tag-bilibili-bangumi/blob/master/LICENSE) + +一个专为 Hexo 设计的基于 [Bilibili-Bangumi-JS](https://github.com/hans362/Bilibili-Bangumi-JS) 的 Bilibili 追番进度展示插件。 + +## 安装 + +``` +npm install hexo-tag-bilibili-bangumi --save +``` + +## 用法 + +在需要插入追番进度的文章(post)或独立页面(page)中,使用如下标签即可插入。 + +``` +{% bangumi key_1=value_1 key_2=value_2 ... key_n=value_n %} +``` + +其中`key_n=value_n`的键值对表示一个设置项及其对应的值,目前支持的设置项有: + +`apiUrl`:**(必填)**设置后端域名(后端的安装请参考[这里](https://github.com/hans362/Bilibili-Bangumi-JS#%E5%90%8E%E7%AB%AF%E5%AE%89%E8%A3%85))。 + +`vmid`:**(必填)**设置 Bilibili UID,可在个人空间中查看。 + +## 进阶 + +在站点的`config.yml`中,可以对本插件进行更加高级的设置。 + +``` +hexo-tag-bilibili-bangumi: + # (可选)设置静态资源的默认存放路径(因主题而异) + js_path: /assets/js/ + css_path: /assets/css/ +``` + +## 感谢❤️ + +- [hexo-tag-dplayer](https://github.com/MoePlayer/hexo-tag-dplayer) - 提供 Hexo 插件的实现思路和大致框架 \ No newline at end of file diff --git a/index.js b/index.js index 79edb48..4b809f3 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,7 @@ const fs = require('hexo-fs'), util = require('hexo-util'), - log = require('hexo-log')({ name: "hexo-tag-bangumi", debug: false }), + log = require('hexo-log')({ name: "hexo-tag-bilibili-bangumi", debug: false }), path = require('path'), srcDir = path.dirname(require.resolve('bilibili-bangumi-js')).split('/api')[0] + '/dist', scriptDir = '/js/', @@ -12,7 +12,7 @@ const fs = require('hexo-fs'), ['bilibili-bangumi.js', scriptDir], ]; -var conf = hexo.config['hexo-tag-bangumi'] || {}, +var conf = hexo.config['hexo-tag-bilibili-bangumi'] || {}, tbIns = []; if (!conf.cdn) {