Skip to content

Commit

Permalink
修复BUG(#134, #182)
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed Oct 21, 2022
1 parent 6b14d92 commit d590a45
Show file tree
Hide file tree
Showing 12 changed files with 618 additions and 289 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@ $ npm install hexo-bilibili-bangumi --save
bangumi: # 追番设置
enable: true
source: bili
bgmInfoSource: 'bgmApi'
path:
vmid:
title: '追番列表'
quote: '生命不息,追番不止!'
show: 1
lazyload: true
srcValue: '__image__'
lazyloadAttrName: 'data-src=__image__'
loading:
showMyComment: false
pagination: false
Expand All @@ -51,6 +54,8 @@ cinema: # 追剧设置
quote: '生命不息,追剧不止!'
show: 1
lazyload: true
srcValue: '__image__'
lazyloadAttrName: 'data-src=__image__'
loading:
metaColor:
color:
Expand All @@ -63,15 +68,18 @@ cinema: # 追剧设置
> 带*为必填选项!
- **enable\***: 是否启用
- **enable**: 是否启用
- **source**: 数据源,仅支持追番,追剧仅支持哔哩哔哩源。`bili`: [哔哩哔哩源](https://www.bilibili.com/), `bgm`: [Bangumi源](https://bangumi.tv/)
- **bgmInfoApi**: 获取Bangumi番剧信息时使用的Api,仅使用Bangumi源时此选项生效。`bgmApi`: [Bangumi Api](https://github.com/bangumi/api/), `bgmSub`: [Bangumi-Subject](https://github.com/czy0729/Bangumi-Subject)
- **proxy**: 代理设置,仅在使用支持`bgm`源追番时生效。默认`false`
- **path**: 页面路径,默认`bangumis/index.html`, `cinemas/index.html`
- **vmid\***: 哔哩哔哩的 `vmid(uid)`[如何获取?](#获取-bilibili-uid)或Bangumi的用户`id`[如何获取?](#获取-bangumi-id)
- **vmid**: 哔哩哔哩的 `vmid(uid)`[如何获取?](#获取-bilibili-uid)或Bangumi的用户`id`[如何获取?](#获取-bangumi-id)
- **title**: 该页面的标题
- **quote**: 写在页面开头的一段话,支持 html 语法,可留空。
- **show**: 初始显示页面:`0: 想看`, `1: 在看`, `2: 看过`,默认为`1`
- **lazyload**: 是否启用图片懒加载,如果与主题的懒加载冲突请关闭,默认`true`
- **srcValue**: 设置封面图的默认`src`值, `__image__`为封面链接, `__loading__`为loading图片链接, `lazyload`选项为`false`时此选项生效
- **lazyloadAttrName**: 设置封面图的属性与属性值, 例`lazyloadAttrName: 'data-src=__image__'`代表为`img`元素添加`data-src`属性, 其值为图片链接, `lazyload`选项为`false`时此选项生效
- **loading**: 图片加载完成前的 loading 图片,需启用图片懒加载
- **metaColor**: meta 部分(简介上方)字体颜色
- **color**: 简介字体颜色
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ hexo.extend.console.register('bangumi', 'Generate pages of bangumis for Hexo', o
sourceDir: this.source_dir,
extraOrder: this.config.bangumi.extraOrder,
pagination: this.config.bangumi.pagination,
proxy: this.config.bangumi.proxy
proxy: this.config.bangumi.proxy,
infoApi: this.config.bangumi.bgmInfoApi
});
} else {
var _this$config$bangumi$2;
Expand Down
2 changes: 2 additions & 0 deletions lib/bangumi-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ module.exports = /*#__PURE__*/function () {
metaColor: config[type].metaColor ? "style=\"color:".concat(config[type].metaColor, "\"") : '',
color: config[type].color ? "style=\"color:".concat(config[type].color, "\"") : '',
lazyload: (_config$type$lazyload = config[type].lazyload) !== null && _config$type$lazyload !== void 0 ? _config$type$lazyload : true,
lazyloadAttrName: config[type].lazyloadAttrName,
srcValue: config[type].srcValue || '__image__',
source: (_config$type$source = config[type].source) !== null && _config$type$source !== void 0 ? _config$type$source : 'bili',
showMyComment: (_config$type$showMyCo = config[type].showMyComment) !== null && _config$type$showMyCo !== void 0 ? _config$type$showMyCo : false,
pagination: (_config$type$paginati = config[type].pagination) !== null && _config$type$paginati !== void 0 ? _config$type$paginati : false,
Expand Down
Loading

0 comments on commit d590a45

Please sign in to comment.