修復 Waline 評論系統 設置 avatarCDN 無效的 bug

This commit is contained in:
Jerry
2021-07-30 01:09:55 +08:00
Unverified
parent 43790dec07
commit 45d6ced507
4 changed files with 30 additions and 14 deletions

View File

@@ -20,7 +20,7 @@ Docs: 📖 [Butterfly Docs](https://butterfly.js.org/posts/21cfbf15/)
Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme. Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) theme.
## Installation ## 💻 Installation
### GIT ### GIT
@@ -48,7 +48,7 @@ In Hexo site root directory
npm i hexo-theme-butterfly npm i hexo-theme-butterfly
``` ```
## Configuration ## Configuration
Set theme in the hexo work folder's root config file `_config.yml`: Set theme in the hexo work folder's root config file `_config.yml`:
@@ -58,7 +58,7 @@ npm i hexo-theme-butterfly
> npm install hexo-renderer-pug hexo-renderer-stylus > npm install hexo-renderer-pug hexo-renderer-stylus
## Features ## 🎉 Features
- [x] Card UI Design - [x] Card UI Design
- [X] Support sub-menu - [X] Support sub-menu
@@ -97,7 +97,13 @@ npm i hexo-theme-butterfly
- [x] Lazyload images - [x] Lazyload images
- [x] Instantpage/Pangu/Snackbar notification toast/PWA...... - [x] Instantpage/Pangu/Snackbar notification toast/PWA......
## Screenshots ## ✨ Contributors
<a href="https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors">
<img src="https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly" />
</a>
## 📷 Screenshots
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg)
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg)

View File

@@ -20,7 +20,7 @@
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題 一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
## 安裝 ## 💻 安裝
### Git 安裝 ### Git 安裝
@@ -48,7 +48,8 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/bu
npm i hexo-theme-butterfly npm i hexo-theme-butterfly
``` ```
## 應用主題 ## 應用主題
修改hexo配置文件`_config.yml`,把主題改為`Butterfly` 修改hexo配置文件`_config.yml`,把主題改為`Butterfly`
``` ```
@@ -57,7 +58,7 @@ theme: butterfly
>如果你沒有pug以及stylus的渲染器請下載安裝 npm install hexo-renderer-pug hexo-renderer-stylus --save >如果你沒有pug以及stylus的渲染器請下載安裝 npm install hexo-renderer-pug hexo-renderer-stylus --save
## 特色 ## 🎉 特色
- [x] 卡片化設計 - [x] 卡片化設計
- [X] 支持二級目錄 - [X] 支持二級目錄
@@ -96,7 +97,13 @@ theme: butterfly
- [x] 圖片懶加載 - [x] 圖片懶加載
- [x] Instantpage/Pangu/Snackbar彈窗/PWA...... - [x] Instantpage/Pangu/Snackbar彈窗/PWA......
## 截圖 ## ✨ 贡献者
<a href="https://github.com/jerryc127/hexo-theme-butterfly/graphs/contributors">
<img src="https://contrib.rocks/image?repo=jerryc127/hexo-theme-butterfly" />
</a>
## 📷 截圖
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-1.jpg)
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg) ![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-2.jpg)

View File

@@ -1,14 +1,17 @@
- const { serverURL, avatar, avatarCDN, visitor, option } = theme.waline
script. script.
function loadWaline () { function loadWaline () {
function initWaline () { function initWaline () {
const waline = new Waline(Object.assign({ const waline = new Waline(Object.assign({
el: '#waline-wrap', el: '#waline-wrap',
serverURL: '!{theme.waline.serverURL}', serverURL: '!{serverURL}',
avatar: '#{theme.waline.avatar}', avatar: '#{avatar}',
avatarCDN: '!{avatarCDN || "https://sdn.geekzu.org/avatar/"}',
path: location.pathname, path: location.pathname,
visitor: #{theme.waline.visitor}, visitor: !{visitor},
dark: 'html[data-theme="dark"]' dark: 'html[data-theme="dark"]'
}, !{JSON.stringify(theme.waline.option)})) }, !{JSON.stringify(option)}))
} }
if (typeof Waline === 'function') initWaline() if (typeof Waline === 'function') initWaline()

View File

@@ -1,6 +1,6 @@
{ {
"name": "hexo-theme-butterfly", "name": "hexo-theme-butterfly",
"version": "4.0.0-b1", "version": "4.0.0-b2",
"description": "A Simple and Card UI Design theme for Hexo", "description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json", "main": "package.json",
"scripts": { "scripts": {