Skip to content

Commit

Permalink
升级主题
Browse files Browse the repository at this point in the history
  • Loading branch information
CCKNBC committed Nov 21, 2024
1 parent 2afc870 commit 138f8e7
Show file tree
Hide file tree
Showing 81 changed files with 1,762 additions and 1,807 deletions.
28 changes: 10 additions & 18 deletions _config.butterfly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -805,10 +805,6 @@ chatra:
tidio:
public_key: rmnlrpff1oci9pui1djmeuvx1mftupfq

# http://dashboard.daovoice.io/app
daovoice:
app_id:

# https://crisp.chat/en/
crisp:
website_id:
Expand Down Expand Up @@ -1079,16 +1075,16 @@ chartjs:
# The default settings are only used when the MD syntax is not specified.
# General font color for the chart
fontColor:
light: "rgba(0, 0, 0, 0.8)"
dark: "rgba(255, 255, 255, 0.8)"
light: 'rgba(0, 0, 0, 0.8)'
dark: 'rgba(255, 255, 255, 0.8)'
# General border color for the chart
borderColor:
light: "rgba(0, 0, 0, 0.1)"
dark: "rgba(255, 255, 255, 0.2)"
light: 'rgba(0, 0, 0, 0.1)'
dark: 'rgba(255, 255, 255, 0.2)'
# Background color for scale labels on radar and polar area charts
scale_ticks_backdropColor:
light: "transparent"
dark: "transparent"
light: 'transparent'
dark: 'transparent'

# Note - Bootstrap Callout
note:
Expand Down Expand Up @@ -1134,13 +1130,6 @@ snackbar:
# https://instant.page/
instantpage: true

# Pangu - Insert a space between Chinese character and English character
# https://github.com/vinta/pangu.js
pangu:
enable: true
# Specify the field to use pangu (site or post)
field: post

# Lazyload
# https://github.com/verlok/vanilla-lazyload
lazyload:
Expand Down Expand Up @@ -1174,6 +1163,10 @@ Open_Graph_meta:
# fb_admins:
# fb_app_id:

# Structured Data
# https://developers.google.com/search/docs/guides/intro-structured-data
structured_data: true

# Add the vendor prefixes to ensure compatibility
css_prefix: true

Expand Down Expand Up @@ -1243,7 +1236,6 @@ CDN:
# medium_zoom:
# mermaid:
# meting_js:
# pangu:
# prismjs_autoloader:
# prismjs_js:
# prismjs_lineNumber_js:
Expand Down
1,813 changes: 701 additions & 1,112 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ccknbc-blog",
"version": "5.1.0-b1",
"version": "5.3.0-b1",
"private": false,
"scripts": {
"build": "hexo generate",
Expand Down
4 changes: 2 additions & 2 deletions themes/butterfly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ npm i hexo-theme-butterfly
- [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)
- [x] Online Chats (Chatra/Tidio/Crisp)
- [x] Web analytics
- [x] Google AdSense
- [x] Webmaster Verification
Expand All @@ -101,7 +101,7 @@ npm i hexo-theme-butterfly
- [x] Chart.js
- [x] Justified Gallery
- [x] Lazyload images
- [x] Instantpage/Pangu/Snackbar notification toast/PWA......
- [x] Instantpage/Snackbar notification toast/PWA......

## ✨ Contributors

Expand Down
4 changes: 2 additions & 2 deletions themes/butterfly/README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ theme: butterfly
- [x] 多種分享系統(Sharejs/Addtoany)
- [X] 多種評論系統(Disqus/Disqusjs/Livere/Gitalk/Valine/Waline/Utterances/Facebook Comments/Twikoo/Giscus/Remark42/artalk)
- [x] 支持雙評論部署
- [x] 多種在線聊天(Chatra/Tidio/Daovoice/Crisp)
- [x] 多種在線聊天(Chatra/Tidio/Crisp)
- [x] 多種分析系統
- [x] 谷歌廣告/手動廣告位置
- [x] 各種站長驗證
Expand All @@ -101,7 +101,7 @@ theme: butterfly
- [x] Chart.js 圖表顯示
- [x] 照片牆
- [x] 圖片懶加載
- [x] Instantpage/Pangu/Snackbar彈窗/PWA......
- [x] Instantpage/Snackbar彈窗/PWA......

## ✨ 貢獻者

Expand Down
30 changes: 11 additions & 19 deletions themes/butterfly/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ artalk:
# --------------------------------------

chat:
# Choose: chatra/tidio/daovoice/crisp
# Choose: chatra/tidio/crisp
# Leave it empty if you don't need chat
use:
# Chat Button [recommend]
Expand All @@ -662,10 +662,6 @@ chatra:
tidio:
public_key:

# http://dashboard.daovoice.io/app
daovoice:
app_id:

# https://crisp.chat/en/
crisp:
website_id:
Expand Down Expand Up @@ -932,16 +928,16 @@ chartjs:
# The default settings are only used when the MD syntax is not specified.
# General font color for the chart
fontColor:
light: "rgba(0, 0, 0, 0.8)"
dark: "rgba(255, 255, 255, 0.8)"
light: 'rgba(0, 0, 0, 0.8)'
dark: 'rgba(255, 255, 255, 0.8)'
# General border color for the chart
borderColor:
light: "rgba(0, 0, 0, 0.1)"
dark: "rgba(255, 255, 255, 0.2)"
light: 'rgba(0, 0, 0, 0.1)'
dark: 'rgba(255, 255, 255, 0.2)'
# Background color for scale labels on radar and polar area charts
scale_ticks_backdropColor:
light: "transparent"
dark: "transparent"
light: 'transparent'
dark: 'transparent'

# Note - Bootstrap Callout
note:
Expand Down Expand Up @@ -987,13 +983,6 @@ snackbar:
# https://instant.page/
instantpage: false

# Pangu - Insert a space between Chinese character and English character
# https://github.com/vinta/pangu.js
pangu:
enable: false
# Specify the field to use pangu (site or post)
field: site

# Lazyload
# https://github.com/verlok/vanilla-lazyload
lazyload:
Expand Down Expand Up @@ -1027,6 +1016,10 @@ Open_Graph_meta:
# fb_admins:
# fb_app_id:

# Structured Data
# https://developers.google.com/search/docs/guides/intro-structured-data
structured_data: true

# Add the vendor prefixes to ensure compatibility
css_prefix: true

Expand Down Expand Up @@ -1096,7 +1089,6 @@ CDN:
# medium_zoom:
# mermaid:
# meting_js:
# pangu:
# prismjs_autoloader:
# prismjs_js:
# prismjs_lineNumber_js:
Expand Down
3 changes: 0 additions & 3 deletions themes/butterfly/layout/includes/additional-js.pug
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ div
if theme.snackbar.enable
script(src=url_for(theme.asset.snackbar))

if theme.pangu.enable
!= partial("includes/third-party/pangu.pug", {}, { cache: true })

.js-pjax
if needLoadCountJs
!= partial("includes/third-party/card-post-count/index", {}, { cache: true })
Expand Down
3 changes: 3 additions & 0 deletions themes/butterfly/layout/includes/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ if is_post()
//- Open_Graph
include ./head/Open_Graph.pug

//- Structured Data
include ./head/structured_data.pug

!=favicon_tag(theme.favicon || config.favicon)
link(rel="canonical" href=urlNoIndex(null,config.pretty_urls.trailing_index,config.pretty_urls.trailing_html))

Expand Down
11 changes: 0 additions & 11 deletions themes/butterfly/layout/includes/head/config.pug
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,6 @@
})
}
let noticeOutdate = 'undefined'
if (theme.noticeOutdate && theme.noticeOutdate.enable) {
noticeOutdate = JSON.stringify({
limitDay: theme.noticeOutdate.limit_day,
position: theme.noticeOutdate.position,
messagePrev: theme.noticeOutdate.message_prev,
messageNext: theme.noticeOutdate.message_next,
})
}
let highlight = 'undefined'
let syntaxHighlighter = config.syntax_highlighter
let highlightEnable = syntaxHighlighter ? ['highlight.js', 'prismjs'].includes(syntaxHighlighter) : (config.highlight.enable || config.prismjs.enable)
Expand All @@ -100,7 +90,6 @@ script.
algolia: !{algolia},
localSearch: !{localSearch},
translate: !{translate},
noticeOutdate: !{noticeOutdate},
highlight: !{highlight},
copy: {
success: '!{_p("copy.success")}',
Expand Down
2 changes: 1 addition & 1 deletion themes/butterfly/layout/includes/head/config_site.pug
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ script#config-diff.
isHome: !{is_home()},
isHighlightShrink: !{isHighlightShrink},
isToc: !{showToc},
postUpdate: '!{full_date(page.updated)}'
isShuoshuo: !{page.type == 'shuoshuo'}
}
34 changes: 34 additions & 0 deletions themes/butterfly/layout/includes/head/structured_data.pug
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
if theme.structured_data && page.layout === 'post'
-
// use json-ld to add structured data
const title = page.title
const url = page.permalink
const imageVal = page.cover_type === 'img' ? page.cover : theme.avatar.img
const image = imageVal ? full_url_for(imageVal) : ''
const datePublished = page.date.toISOString()
const dateModified = (page.updated || page.date).toISOString()
const author = page.copyright_author || config.author
const authorHrefVal = page.copyright_author_href || theme.post_copyright.author_href || site.url;
const authorHref = full_url_for(authorHrefVal);
const jsonLd = {
"@context": "https://schema.org",
"@type": "BlogPosting",
"headline": title,
"url": url,
"image": image,
"datePublished": datePublished,
"dateModified": dateModified,
"author": [{
"@type": "Person",
"name": author,
"url": authorHref
}]
};
jsonLdScript = JSON.stringify(jsonLd, null, 2);
-
script(type="application/ld+json").
!{jsonLdScript}
12 changes: 3 additions & 9 deletions themes/butterfly/layout/includes/mixins/indexPostUI.pug
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,9 @@ mixin indexPostUI()
i.fa-solid.fa-spinner.fa-spin

//- Display the article introduction on homepage
case theme.index_post_content.method
when false
- break
when 1
.content!= article.description
when 2
.content!= article.description || truncate(article.content, theme.index_post_content.length)
default
.content!= truncate(article.content, theme.index_post_content.length)
- const content = postDesc(article)
if content
.content!=content

if theme.ad && theme.ad.index
if (index + 1) % 3 === 0
Expand Down
2 changes: 1 addition & 1 deletion themes/butterfly/layout/includes/page/default-page.pug
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#article-container
#article-container.container
!= page.content
2 changes: 1 addition & 1 deletion themes/butterfly/layout/includes/page/flink.pug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#article-container
#article-container.container
.flink
- let { content, random, flink_url } = page
- let pageContent = content
Expand Down
Loading

0 comments on commit 138f8e7

Please sign in to comment.