Skip to content

Commit

Permalink
Merge pull request #320 from Einstein-schrodinger/main
Browse files Browse the repository at this point in the history
update: 新增Waline基础配置项,支持对Waline评论的自定义配置
  • Loading branch information
jiewenhuang authored Sep 11, 2024
2 parents 03a2621 + 51e96ae commit b85aeeb
Show file tree
Hide file tree
Showing 20 changed files with 868 additions and 35 deletions.
74 changes: 74 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,80 @@
- [x] [图库](https://github.com/halo-sigs/plugin-photos)
- [x] 其他功能

## 主题配置

### 基本设置

#### Waline设置

##### Waline基础配置

该配置项可以对Waline进行自定义基础配置,内容为json格式,如果配置未生效,请先检查填入的内容是否为json格式,可以前往[JSON校验网站](https://www.json.cn/)进行格式校验。为了方便用户填写,这里提供如下样例,具体所代表的含义以及更多配置项请参考[Waline官网](https://waline.js.org/)

```json
{
"search":false,
"reaction":true,
"login":"force",
"locale": {
"placeholder":"欢迎评论啦啦啦"
},
"emoji": [
"//unpkg.com/@waline/emojis@1.2.0/weibo",
"//unpkg.com/@waline/emojis@1.2.0/bmoji"
]
}
```

##### Waline图片上传配置

该配置项可以配置Waline的图片上传方式

+ 默认

默认的图片上传方式上传的图片最大只能128Kb

+ 兰空图床

该配置项可以配置Waline的图片上传至兰空图床,需要自建兰空图床服务

##### 兰空图床上传设置

+ 兰空图床服务端地址

兰空图床服务端地址,如 https://img.example.com/api/v1/upload 不要加结尾反斜杠

+ 兰空图床Token

兰空图床Token,如 `2|1bJbwlqBfnggmOMEZqXT5XusaIwqiZjCDs7r1Ob5`,通过配置Token可以进行图片上传的权限控制,如果为空则以游客身份上传(需要在兰空图床开放游客上传的权限)

如何获取Token?

通过兰空图床api获取,请求示例如下:

```bash
curl -X POST https://img.example.com/api/v1/tokens \
-H "Content-Type: application/json" \
-d '{
"email": "email@qq.com",
"password": "password***"
}'
```

如果出现如下报错,请在末尾加入参数`-k`来忽略证书验证

```bash
curl: (60) schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it.
```

返回结果示例:

```json
{"status":true,"message":"success","data":{"token":"2|1bJbwlqBfnggmOMEZqXT5XusaIwqiZjCDs7r1Ob5"}}
```

## 预览
WIP
Expand Down
227 changes: 227 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,39 @@ spec:
label: 列表 JS
value: 'https://unpkg.com/@waline/client@v2/dist/comment.mjs'
help: 首页加载显示评论数的 JS 地址
- $formkit: code
name: waline_config_basic_json
label: Waline 基础配置
value: ''
help: 'Waline 基础配置(json格式),更多配置项请参考 Waline官网:https://waline.js.org'
language: json
- $formkit: radio
name: waline_config_imageUpload_option
id: waline_config_imageUpload_option
value: default
label: Waline 图片上传配置
help: "选择图片上传方式"
options:
- value: default
label: 默认
- value: lskypro
label: 兰空图床
- $formkit: group
name: lskypro
if: "$get(waline_config_imageUpload_option).value === 'lskypro'"
label: 兰空图床上传 设置
id: lskypro
children:
- $formkit: text
name: lskypro_apiURL
label: 兰空图床 服务端地址
value: ""
help: "兰空图床 服务端地址,如 https://img.example.com/api/v1/upload 不要加结尾反斜杠"
- $formkit: text
name: lskypro_apiTOKEN
label: 兰空图床 Token
value: ""
help: "兰空图床 Token,如 2|1bJbwlqBfnggmOMEZqXT5XusaIwqiZjCDs7r1Ob5"

- $formkit: radio
name: enable_source_link
Expand Down Expand Up @@ -1108,6 +1141,8 @@ spec:
value: bilibili
- label: QQ
value: qq
- label: 微信
value: wechat
- label: 微博
value: weibo
- label: 豆瓣
Expand Down Expand Up @@ -1564,6 +1599,16 @@ spec:
label:
- value: false
label:
- $formkit: select
name: enable_friends_aside
label: 朋友圈侧边栏
value: true
help: '朋友圈右侧是否展示侧边栏'
options:
- value: true
label:
- value: false
label:
- $formkit: select
name: enable_sheet_aside
label: 自定义页侧边栏
Expand Down Expand Up @@ -2504,6 +2549,188 @@ spec:
label: 底部显示内容
value: ''
language: html
- group: friends
label: 朋友圈
formSchema:
- $formkit: select
name: enable_friend_effect
label: 开启缓入动画
value: true
help: '是否开启朋友圈列表缓入动画'
options:
- value: true
label:
- value: false
label:
- $formkit: text
name: friends_title
label: 朋友圈标题
value: '朋友圈'
- $formkit: select
name: enable_friend_add
label: 展示新增订阅按钮
value: false
options:
- value: true
label:
- value: false
label:
- $formkit: select
name: friend_list_effect_class
label: 动画效果类名
value: 'fadeInUp'
help: '朋友圈列表动画效果类名,来自 animate.css,默认 fadeInUp'
options:
- value: 'fadeIn'
label: 'fadeIn'
- value: 'fadeInUp'
label: 'fadeInUp'
- value: 'fadeInDown'
label: 'fadeInDown'
- value: 'fadeInDownBig'
label: 'fadeInDownBig'
- value: 'fadeInLeft'
label: 'fadeInLeft'
- value: 'fadeInLeftBig'
label: 'fadeInLeftBig'
- value: 'fadeInRight'
label: 'fadeInRight'
- value: 'fadeInRightBig'
label: 'fadeInRightBig'
- value: 'fadeInUpBig'
label: 'fadeInUpBig'
- value: 'fadeOut'
label: 'fadeOut'
- value: 'fadeOutDown'
label: 'fadeOutDown'
- value: 'fadeOutDownBig'
label: 'fadeOutDownBig'
- value: 'fadeOutLeft'
label: 'fadeOutLeft'
- value: 'fadeOutLeftBig'
label: 'fadeOutLeftBig'
- value: 'fadeOutRight'
label: 'fadeOutRight'
- value: 'fadeOutRightBig'
label: 'fadeOutRightBig'
- value: 'fadeOutUp'
label: 'fadeOutUp'
- value: 'fadeOutUpBig'
label: 'fadeOutUpBig'
- value: 'bounce'
label: 'bounce'
- value: 'flash'
label: 'flash'
- value: 'pulse'
label: 'pulse'
- value: 'rubberBand'
label: 'rubberBand'
- value: 'headShake'
label: 'headShake'
- value: 'swing'
label: 'swing'
- value: 'tada'
label: 'tada'
- value: 'wobble'
label: 'wobble'
- value: 'jello'
label: 'jello'
- value: 'heartBeat'
label: 'heartBeat'
- value: 'bounceIn'
label: 'bounceIn'
- value: 'bounceInDown'
label: 'bounceInDown'
- value: 'bounceInLeft'
label: 'bounceInLeft'
- value: 'bounceInRight'
label: 'bounceInRight'
- value: 'bounceInUp'
label: 'bounceInUp'
- value: 'bounceOut'
label: 'bounceOut'
- value: 'bounceOutDown'
label: 'bounceOutDown'
- value: 'bounceOutLeft'
label: 'bounceOutLeft'
- value: 'bounceOutRight'
label: 'bounceOutRight'
- value: 'bounceOutUp'
label: 'bounceOutUp'
- value: 'flip'
label: 'flip'
- value: 'flipInX'
label: 'flipInX'
- value: 'flipInY'
label: 'flipInY'
- value: 'flipOutX'
label: 'flipOutX'
- value: 'flipOutY'
label: 'flipOutY'
- value: 'rotateIn'
label: 'rotateIn'
- value: 'rotateInDownLeft'
label: 'rotateInDownLeft'
- value: 'rotateInDownRight'
label: 'rotateInDownRight'
- value: 'rotateInUpLeft'
label: 'rotateInUpLeft'
- value: 'rotateInUpRight'
label: 'rotateInUpRight'
- value: 'rotateOut'
label: 'rotateOut'
- value: 'rotateOutDownLeft'
label: 'rotateOutDownLeft'
- value: 'rotateOutDownRight'
label: 'rotateOutDownRight'
- value: 'rotateOutUpLeft'
label: 'rotateOutUpLeft'
- value: 'rotateOutUpRight'
label: 'rotateOutUpRight'
- value: 'hinge'
label: 'hinge'
- value: 'jackInTheBox'
label: 'jackInTheBox'
- value: 'rollIn'
label: 'rollIn'
- value: 'rollOut'
label: 'rollOut'
- value: 'zoomIn'
label: 'zoomIn'
- value: 'zoomInDown'
label: 'zoomInDown'
- value: 'zoomInLeft'
label: 'zoomInLeft'
- value: 'zoomInRight'
label: 'zoomInRight'
- value: 'zoomInUp'
label: 'zoomInUp'
- value: 'zoomOut'
label: 'zoomOut'
- value: 'zoomOutDown'
label: 'zoomOutDown'
- value: 'zoomOutLeft'
label: 'zoomOutLeft'
- value: 'zoomOutRight'
label: 'zoomOutRight'
- value: 'zoomOutUp'
label: 'zoomOutUp'
- value: 'slideInDown'
label: 'slideInDown'
- value: 'slideInLeft'
label: 'slideInLeft'
- value: 'slideInRight'
label: 'slideInRight'
- value: 'slideInUp'
label: 'slideInUp'
- value: 'slideOutDown'
label: 'slideOutDown'
- value: 'slideOutLeft'
label: 'slideOutLeft'
- value: 'slideOutRight'
label: 'slideOutRight'
- value: 'slideOutUp'
label: 'slideOutUp'
- group: leaving
label: 留言页
formSchema:
Expand Down
Loading

0 comments on commit b85aeeb

Please sign in to comment.