diff --git a/README.md b/README.md
index e0189ba..2dfcfab 100644
--- a/README.md
+++ b/README.md
@@ -76,7 +76,7 @@ npm i hexo-theme-butterfly
- [x] WordCount
- [x] Related articles
- [x] Displays outdated notice for a post
-- [x] Share (AddThis/Sharejs/Addtoany)
+- [x] Share (Sharejs/Addtoany)
- [X] Comment (Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/artalk)
- [x] Multiple Comment System Support
- [x] Online Chats (Chatra/Tidio/Daovoice/Crisp/messenger)
diff --git a/README_CN.md b/README_CN.md
index 441cd79..2b3c3b6 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -76,7 +76,7 @@ theme: butterfly
- [x] 顯示字數統計
- [x] 顯示相關文章
- [x] 過期文章提醒
-- [x] 多種分享系統(AddThis/Sharejs/Addtoany)
+- [x] 多種分享系統(Sharejs/Addtoany)
- [X] 多種評論系統(Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/artalk)
- [x] 支持雙評論部署
- [x] 多種在線聊天(Chatra/Tidio/Daovoice/Crisp/messenger)
diff --git a/_config.yml b/_config.yml
index 5c1b8d1..3c4f5c5 100644
--- a/_config.yml
+++ b/_config.yml
@@ -264,6 +264,10 @@ aside:
post_count: true
last_push_date: true
sort_order: # Don't modify the setting unless you know how it works
+ card_post_series:
+ enable: true
+ orderBy: 'date' # Order by title or date
+ order: -1 # Sort of order. 1, asc for ascending; -1, desc for descending
# busuanzi count for PV / UV in site
# 訪問人數
@@ -381,12 +385,6 @@ docsearch:
# Share System (分享)
# --------------------------------------
-# AddThis
-# https://www.addthis.com/
-addThis:
- enable: false
- pubid:
-
# Share.js
# https://github.com/overtrue/share.js
sharejs:
@@ -651,7 +649,7 @@ mask:
footer: true
# the position of bottom right button/default unit: px (右下角按鈕距離底部的距離/默認單位為px)
-rightside-bottom:
+rightside_bottom:
# Enter transitions (開啓網頁進入效果)
enter_transitions: true
@@ -796,6 +794,13 @@ fancybox: true
# Tag Plugins settings (標籤外掛)
# --------------------------------------
+# series (系列文章)
+series:
+ enable: true
+ orderBy: 'title' # Order by title or date
+ order: 1 # Sort of order. 1, asc for ascending; -1, desc for descending
+ number: true
+
# abcjs (樂譜渲染)
# See https://github.com/paulrosen/abcjs
abcjs:
diff --git a/languages/default.yml b/languages/default.yml
index fea921e..0f80672 100644
--- a/languages/default.yml
+++ b/languages/default.yml
@@ -15,7 +15,6 @@ page:
card_post_count: comments
-sticky: Sticky
no_title: No title
post:
@@ -83,6 +82,7 @@ aside:
link: link
code: code
card_toc: Catalog
+ card_post_series: Series
date_suffix:
just: Just
diff --git a/languages/en.yml b/languages/en.yml
index 1cc937c..3c14a5d 100644
--- a/languages/en.yml
+++ b/languages/en.yml
@@ -15,7 +15,6 @@ page:
card_post_count: comments
-sticky: Sticky
no_title: No title
post:
@@ -83,6 +82,7 @@ aside:
link: link
code: code
card_toc: Catalog
+ card_post_series: Series
date_suffix:
just: Just
diff --git a/languages/zh-CN.yml b/languages/zh-CN.yml
index 94f85cd..3cd8964 100644
--- a/languages/zh-CN.yml
+++ b/languages/zh-CN.yml
@@ -15,7 +15,6 @@ page:
card_post_count: 条评论
-sticky: 置顶
no_title: 无题
post:
@@ -84,6 +83,7 @@ aside:
link: 链接
code: 代码
card_toc: 目录
+ card_post_series: 系列文章
date_suffix:
just: 刚刚
diff --git a/languages/zh-TW.yml b/languages/zh-TW.yml
index 9801d16..b2f8f68 100644
--- a/languages/zh-TW.yml
+++ b/languages/zh-TW.yml
@@ -15,7 +15,6 @@ page:
card_post_count: 條評論
-sticky: 置頂
no_title: 無題
post:
@@ -84,6 +83,7 @@ aside:
link: 連結
code: 程式碼
card_toc: 目錄
+ card_post_series: 系列文章
date_suffix:
just: 剛剛
diff --git a/layout/includes/mixins/post-ui.pug b/layout/includes/mixins/post-ui.pug
index 970b5fc..200e900 100644
--- a/layout/includes/mixins/post-ui.pug
+++ b/layout/includes/mixins/post-ui.pug
@@ -19,13 +19,11 @@ mixin postUI(posts)
else
div.post-bg(style=`background: ${post_cover}`)
.recent-post-info(class=no_cover)
- a.article-title(href=url_for(link) title=title)= title
- .article-meta-wrap
+ a.article-title(href=url_for(link) title=title)
if (is_home() && (article.top || article.sticky > 0))
- span.article-meta
- i.fas.fa-thumbtack.sticky
- span.sticky= _p('sticky')
- span.article-meta-separator |
+ i.fas.fa-thumbtack.sticky
+ = title
+ .article-meta-wrap
if (theme.post_meta.page.date_type)
span.post-meta-date
if (theme.post_meta.page.date_type === 'both')
diff --git a/layout/includes/post/reward.pug b/layout/includes/post/reward.pug
index 71daa98..fb55946 100644
--- a/layout/includes/post/reward.pug
+++ b/layout/includes/post/reward.pug
@@ -1,7 +1,7 @@
.post-reward
.reward-button
i.fas.fa-qrcode
- = ' ' + _p('donate')
+ = theme.reward.text || _p('donate')
.reward-main
ul.reward-all
each item in theme.reward.QR_code
diff --git a/layout/includes/third-party/share/add-this.pug b/layout/includes/third-party/share/add-this.pug
deleted file mode 100644
index ab44267..0000000
--- a/layout/includes/third-party/share/add-this.pug
+++ /dev/null
@@ -1,2 +0,0 @@
-.addthis_inline_share_toolbox
-script(src=`//s7.addthis.com/js/300/addthis_widget.js#pubid=${theme.addThis.pubid}` async)
\ No newline at end of file
diff --git a/layout/includes/third-party/share/index.pug b/layout/includes/third-party/share/index.pug
index f28ceab..f8122c0 100644
--- a/layout/includes/third-party/share/index.pug
+++ b/layout/includes/third-party/share/index.pug
@@ -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})
diff --git a/layout/includes/widget/card_post_series.pug b/layout/includes/widget/card_post_series.pug
new file mode 100644
index 0000000..c216929
--- /dev/null
+++ b/layout/includes/widget/card_post_series.pug
@@ -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)]
diff --git a/layout/includes/widget/index.pug b/layout/includes/widget/index.pug
index 175fcdc..388ea1c 100644
--- a/layout/includes/widget/index.pug
+++ b/layout/includes/widget/index.pug
@@ -13,6 +13,8 @@
.sticky_layout
if showToc
include ./card_post_toc.pug
+ if page.series
+ include ./card_post_series.pug
!=partial('includes/widget/card_recent_post', {}, {cache: true})
!=partial('includes/widget/card_ad', {}, {cache: true})
else
diff --git a/plugins.yml b/plugins.yml
index ef96ad0..e006d32 100644
--- a/plugins.yml
+++ b/plugins.yml
@@ -1,11 +1,11 @@
algolia_search:
name: algoliasearch
file: dist/algoliasearch-lite.umd.js
- version: 4.17.1
+ version: 4.18.0
instantsearch:
name: instantsearch.js
file: dist/instantsearch.production.min.js
- version: 4.56.1
+ version: 4.56.3
pjax:
name: pjax
file: pjax.min.js
@@ -64,16 +64,16 @@ katex:
name: katex
file: dist/katex.min.css
other_name: KaTeX
- version: 0.16.7
+ version: 0.16.8
katex_copytex:
name: katex
file: dist/contrib/copy-tex.min.js
other_name: KaTeX
- version: 0.16.7
+ version: 0.16.8
mermaid:
name: mermaid
file: dist/mermaid.min.js
- version: 10.2.2
+ version: 10.2.3
canvas_ribbon:
name: butterfly-extsrc
file: dist/canvas-ribbon.min.js
@@ -202,12 +202,12 @@ docsearch_js:
name: '@docsearch/js'
other_name: docsearch-js
file: dist/umd/index.js
- version: 3.4.0
+ version: 3.5.1
docsearch_css:
name: '@docsearch/css'
other_name: docsearch-css
file: dist/style.css
- version: 3.4.0
+ version: 3.5.1
abcjs_basic_js:
name: abcjs
file: dist/abcjs-basic-min.js
diff --git a/scripts/helpers/series.js b/scripts/helpers/series.js
new file mode 100644
index 0000000..e1c9338
--- /dev/null
+++ b/scripts/helpers/series.js
@@ -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))
+})
diff --git a/scripts/tag/button.js b/scripts/tag/button.js
index 33a0e53..624cdd3 100644
--- a/scripts/tag/button.js
+++ b/scripts/tag/button.js
@@ -9,17 +9,9 @@
const urlFor = require('hexo-util').url_for.bind(hexo)
-function btn (args) {
+const btn = args => {
args = args.join(' ').split(',')
- let url = args[0] || ''
- let text = args[1] || ''
- let icon = args[2] || ''
- let option = args[3] || ''
-
- url = url.trim()
- text = text.trim()
- icon = icon.trim()
- option = option.trim()
+ const [url = '', text = '', icon = '', option = ''] = args.map(arg => arg.trim())
return `${icon.length ? `` : ''}${text.length ? `${text}` : ''}`
diff --git a/scripts/tag/gallery.js b/scripts/tag/gallery.js
index 632c514..14cdee3 100644
--- a/scripts/tag/gallery.js
+++ b/scripts/tag/gallery.js
@@ -10,7 +10,7 @@
const urlFor = require('hexo-util').url_for.bind(hexo)
-function gallery (args, content) {
+const gallery = (args, content) => {
const { data, languages } = hexo.theme.i18n
args = args.join(' ').split(',')
let rowHeight, limit, lazyload, type, dataStr
@@ -47,19 +47,18 @@ function gallery (args, content) {
`
}
-function galleryGroup (args) {
- const name = args[0]
- const descr = args[1]
- const url = urlFor(args[2])
- const img = urlFor(args[3])
+const galleryGroup = args => {
+ const [name, descr, url, img] = args
+ const imgUrl = urlFor(img)
+ const urlLink = urlFor(url)
return `
${descr}
+
${escapeHTML(content)}