Skip to content

Commit

Permalink
Merge branch 'dev' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryc127 committed Aug 5, 2020
2 parents ee45f65 + 065093e commit fcd4309
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IMPORTANT: Please follow the template to create a new issue.
重要:請依照該模板來提交。
If you upgrade from the old version, and an error occurs when running, please copy the new content in the config to the butterfly.yml
如果你是由舊版本升級到新版,執行時出現報錯,請首先把config裡新的內容複製到舊的butterfly設定去
如果你是由舊版本升級到新版,執行時出現報錯,請首先把config裡新的內容複製到舊的butterfly設定去(如有)
If you are a problem when visit the website, please open your browser 'developer tools (shortcut F12)' and check the console if there is an error, include your website address in the feedback
如果你是線上訪問出現問題,請檢查瀏覽器‘開發人員工具(快捷鍵F12)’的console是否有報錯,反饋時附上你的網站
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) t

## Installation

### GIT

Stable branch [recommend]:

```
Expand All @@ -27,6 +29,16 @@ Dev branch:
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
```

### NPM

> It supports Hexo 5.0.0 or later
In Hexo site root directory

```powershell
npm i hexo-theme-butterfly
```

## Configuration

Set theme in the hexo work folder's root config file `_config.yml`:
Expand Down
18 changes: 15 additions & 3 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,30 @@

## 安裝

在你的博客根目錄裡安裝穩定版【推薦】
### Git 安裝

```
在博客根目錄裡安裝穩定版【推薦】

```powershell
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
```

如果想要安裝比較新的dev分支,可以

```
```powershell
git clone -b dev https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
```

### npm 安裝

> 此方法只支持Hexo 5.0.0以上版本
在博客根目錄裡

```powershell
npm i hexo-theme-butterfly
```

## 應用主題
修改hexo配置文件`_config.yml`,把主題改為`Butterfly`

Expand Down
21 changes: 13 additions & 8 deletions layout/includes/third-party/comments/livere.pug
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
script.
function loadLivere () {
(function(d, s) {
var j, e = d.getElementsByTagName(s)[0];
if (typeof LivereTower === 'function') { return; }
j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;
e.parentNode.insertBefore(j, e);
})(document, 'script');
if (typeof LivereTower === 'object') {
window.LivereTower.init()
}
else {
(function(d, s) {
var j, e = d.getElementsByTagName(s)[0];
if (typeof LivereTower === 'function') { return; }
j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;
e.parentNode.insertBefore(j, e);
})(document, 'script');
}
}

if ('!{theme.comments.use[0]}' === 'Livere' || !!{theme.comments.lazyload}) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo-theme-butterfly",
"version": "3.0.0-rc2",
"version": "3.0.0",
"description": "A Simple and Card UI Design theme for Hexo",
"main": "package.json",
"scripts": {
Expand All @@ -23,7 +23,7 @@
"email": "[email protected]"
},
"dependencies": {
"hexo-renderer-marked": "^3.0.0",
"hexo-renderer-stylus": "^1.1.0",
"hexo-renderer-pug": "^1.0.0"
},
"homepage": "https://demo.jerryc.me/",
Expand Down
15 changes: 15 additions & 0 deletions scripts/events/log.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
hexo.on('ready', () => {
const { version } = require('../../package.json')
hexo.log.info(`
===================================================================
##### # # ##### ##### ###### ##### ###### # # #
# # # # # # # # # # # # #
##### # # # # ##### # # ##### # #
# # # # # # # ##### # # #
# # # # # # # # # # # #
##### #### # # ###### # # # ###### #
${version}
===================================================================`)
})
2 changes: 1 addition & 1 deletion scripts/filters/random_cover.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function randomCover () {
let cover
let num

if (theme.cover.default_cover) {
if (theme.cover && theme.cover.default_cover) {
if (!Array.isArray(theme.cover.default_cover)) {
cover = theme.cover.default_cover
return cover
Expand Down

0 comments on commit fcd4309

Please sign in to comment.