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

pull/634/head
Jerry 3 years ago
parent 43790dec07
commit 45d6ced507

@ -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.
## Installation
## 💻 Installation
### GIT
@ -48,7 +48,7 @@ In Hexo site root directory
npm i hexo-theme-butterfly
```
## Configuration
## Configuration
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
## Features
## 🎉 Features
- [x] Card UI Design
- [X] Support sub-menu
@ -97,7 +97,13 @@ npm i hexo-theme-butterfly
- [x] Lazyload images
- [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-2.jpg)

@ -20,7 +20,7 @@
一款基於[hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody)修改的主題
## 安裝
## 💻 安裝
### Git 安裝
@ -48,7 +48,8 @@ git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/bu
npm i hexo-theme-butterfly
```
## 應用主題
## ⚙ 應用主題
修改hexo配置文件`_config.yml`,把主題改為`Butterfly`
```
@ -57,7 +58,7 @@ theme: butterfly
>如果你沒有pug以及stylus的渲染器請下載安裝 npm install hexo-renderer-pug hexo-renderer-stylus --save
## 特色
## 🎉 特色
- [x] 卡片化設計
- [X] 支持二級目錄
@ -96,11 +97,17 @@ theme: butterfly
- [x] 圖片懶加載
- [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-2.jpg)
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-3.jpg)
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/butterfly-readme-screenshots-4.jpg)
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-homepage-1.png)
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-homepage-2.png)
![](https://cdn.jsdelivr.net/gh/jerryc127/CDN/img/theme-butterfly-readme-homepage-2.png)

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

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

Loading…
Cancel
Save