forked from jerryc127/hexo-theme-butterfly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking changes: 更改 rightside-bottom 為 rightside_bottom
feat: 置頂圖標改為在標題左側 feat: 可配置打賞按鈕的文字 feat: 側邊欄增加 系列文章顯示 feat: 增加 series 系列文章 標籤外掛 feat: 移除 addthis 分享 improvement: 代碼優化 improvement: tabs 標籤外掛的回到頂部箭頭位置調整 improvement: 更新 plugin.yml
- Loading branch information
Showing
30 changed files
with
222 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
.post_share | ||
if theme.addThis.enable | ||
!=partial('includes/third-party/share/add-this', {}, {cache: true}) | ||
else if theme.sharejs.enable | ||
if theme.sharejs.enable | ||
include ./share-js.pug | ||
else if theme.addtoany.enable | ||
!=partial('includes/third-party/share/addtoany', {}, {cache: true}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
if theme.aside.card_post_series.enable | ||
- const array = fragment_cache('seriesArr', groupPosts) | ||
.card-widget.card-post-series | ||
.item-headline | ||
i.fa-solid.fa-layer-group | ||
span= _p('aside.card_post_series') | ||
.aside-list | ||
each item in array[page.series] | ||
- const { path, title = _p('no_title'), cover, cover_type, date:dateA } = item | ||
- let link = url_for(path) | ||
- let no_cover = cover === false || !theme.cover.aside_enable ? 'no-cover' : '' | ||
.aside-list-item(class=no_cover) | ||
if cover && theme.cover.aside_enable | ||
a.thumbnail(href=link title=title) | ||
if cover_type === 'img' | ||
img(src=url_for(cover) onerror=`this.onerror=null;this.src='${url_for(theme.error_img.post_page)}'` alt=title) | ||
else | ||
div(style=`background: ${cover}`) | ||
.content | ||
a.title(href=link title=title)= title | ||
time(datetime=date_xml(dateA) title=_p('post.created') + ' ' + full_date(dateA)) #[=date(dateA, config.date_format)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
|
||
hexo.extend.helper.register('groupPosts', function () { | ||
const getGroupArray = array => { | ||
const groups = {} | ||
array.forEach(item => { | ||
const Key = item.series | ||
if (!Key) return | ||
groups[Key] = groups[Key] || [] | ||
groups[Key].push(item) | ||
}) | ||
return groups | ||
} | ||
|
||
const sortPosts = posts => { | ||
const { orderBy = 'date', order = 1 } = this.theme.aside.card_post_series | ||
if (orderBy === 'title') return posts.sort('title', order) | ||
return posts.sort('date', order) | ||
} | ||
|
||
return getGroupArray(sortPosts(this.site.posts)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.