Skip to content

Commit

Permalink
feat: 替換 Justified Gallery 為 flickr-justified-gallery
Browse files Browse the repository at this point in the history
feat: 完全移除 jquery
feat: 清除配置文件的CDN, 默認 CDN 不再顯示在 config
feat: 切換夜間模式後, mermaid 也會切換夜間主題
feat: 移除騰訊分析
feat: 移除右下角字體調整按鈕
feat: 本地搜索可處理 json
feat: 右下角按鈕自定義順序
feat: 右小角按鈕 UI 微調
improvement: 手機端更改閲讀模式退出按鈕到右下角
improvement: photofigcaption 和 fancybox 的 figcaption 優先顯示 圖片的title屬性,然後是 alt 屬性
improvement: 首頁ui微調
improvement: 禁止一些瀏覽器會出現點擊左下角按鈕出現放大網頁的行為
improvement: js 優化
fix: 修復窗口大小改變時,導航欄的ui 可能會錯亂的 bug
fix: 修復 pjax 下, twikoo 評論獲取是上一篇評論的 bug
fix: 壓縮 html 代碼後, mermaid 顯示正常
  • Loading branch information
jerryc127 committed Oct 12, 2021
1 parent 7e729cf commit cb82bfb
Show file tree
Hide file tree
Showing 34 changed files with 601 additions and 560 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Based on [hexo-theme-melody](https://github.com/Molunerfinn/hexo-theme-melody) t

### GIT

> If you are in Mainland China, you can download in [Gitee](https://gitee.com/iamjerryw/hexo-theme-butterfly)
> If you are in Mainland China, you can download in [Gitee](https://gitee.com/immyw/hexo-theme-butterfly.git)
Stable branch [recommend]:

Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

### Git 安裝

> 本倉庫同時上傳到 [Gitee](https://gitee.com/iamjerryw/hexo-theme-butterfly),如果你訪問 Github 緩慢,可從 Gitee 中下載。
> 本倉庫同時上傳到 [Gitee](https://gitee.com/immyw/hexo-theme-butterfly.git),如果你訪問 Github 緩慢,可從 Gitee 中下載。
在博客根目錄裡安裝穩定版【推薦】

Expand Down
124 changes: 63 additions & 61 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,6 @@ baidu_analytics:
# https://analytics.google.com/analytics/web/
google_analytics:

# Tencent Analytics ID
# https://mta.qq.com
tencent_analytics:

# CNZZ Analytics
# https://www.umeng.com/
cnzz_analytics:
Expand Down Expand Up @@ -673,9 +669,6 @@ newest_comments:
# Bottom right button (右下角按鈕)
# --------------------------------------

# Change font size
change_font_size: false

# Conversion between Traditional and Simplified Chinese (簡繁轉換)
translate:
enable: false
Expand Down Expand Up @@ -704,6 +697,14 @@ darkmode:
# autoChangeMode: false
autoChangeMode: false

# Don't modify the following settings unless you know how they work (非必要請不要修改 )
# Choose: readmode,translate,darkmode,hideAside,toc,chat,comment
# Don't repeat 不要重複
rightside_item_order:
enable: false
hide: # readmode,translate,darkmode,hideAside
show: # toc,chat,comment

# Lightbox (圖片大圖查看模式)
# --------------------------------------
# You can only choose one, or neither (只能選擇一個 或者 兩個都不選)
Expand All @@ -724,7 +725,9 @@ fancybox: true
mermaid:
enable: false
# built-in themes: default/forest/dark/neutral
theme: default
theme:
light: default
dark: dark

# Note (Bootstrap Callout)
note:
Expand Down Expand Up @@ -817,86 +820,85 @@ inject:
# 非必要請不要修改
CDN:
# main
main_css: /css/index.css
jquery: https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js
main: /js/main.js
utils: /js/utils.js
main_css:
main:
utils:

# pjax
pjax: https://cdn.jsdelivr.net/npm/pjax/pjax.min.js
pjax:

# comments
gitalk: https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js
gitalk_css: https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css
valine: https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js
disqusjs: https://cdn.jsdelivr.net/npm/disqusjs@1/dist/disqus.js
disqusjs_css: https://cdn.jsdelivr.net/npm/disqusjs@1/dist/disqusjs.css
utterances: https://utteranc.es/client.js
twikoo: https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js
waline: https://cdn.jsdelivr.net/npm/@waline/client/dist/Waline.min.js
gitalk:
gitalk_css:
valine:
disqusjs:
disqusjs_css:
utterances:
twikoo:
waline:

# share
addtoany: https://static.addtoany.com/menu/page.js
sharejs: https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js
sharejs_css: https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css
addtoany:
sharejs:
sharejs_css:

# search
local_search: /js/search/local-search.js
algolia_js: /js/search/algolia.js
algolia_search: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.js
algolia_search_css: https://cdn.jsdelivr.net/npm/instantsearch.js@2.10.5/dist/instantsearch.min.css
local_search:
algolia_js:
algolia_search:
algolia_search_css:

# math
mathjax: https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
katex: https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css
katex_copytex: https://cdn.jsdelivr.net/npm/katex@latest/dist/contrib/copy-tex.min.js
katex_copytex_css: https://cdn.jsdelivr.net/npm/katex@latest/dist/contrib/copy-tex.css
mermaid: https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js
mathjax:
katex:
katex_copytex:
katex_copytex_css:
mermaid:

# count
busuanzi: //busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js
busuanzi:

# background effect
canvas_ribbon: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-ribbon.min.js
canvas_fluttering_ribbon: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-fluttering-ribbon.min.js
canvas_nest: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.min.js
canvas_ribbon:
canvas_fluttering_ribbon:
canvas_nest:

lazyload: https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js
instantpage: https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js
typed: https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js
pangu: https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js
lazyload:
instantpage:
typed:
pangu:

# photo
fancybox_css: https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css
fancybox: https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js
medium_zoom: https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js
fancybox_css:
fancybox:
medium_zoom:

# snackbar
snackbar_css: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css
snackbar: https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js
snackbar_css:
snackbar:

# effect
activate_power_mode: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js
fireworks: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/fireworks.min.js
click_heart: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-heart.min.js
ClickShowText: https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js
activate_power_mode:
fireworks:
click_heart:
ClickShowText:

# fontawesome
fontawesome: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css
fontawesome:

# Conversion between Traditional and Simplified Chinese
translate: /js/tw_cn.js
translate:

# justifiedGallery
justifiedGallery_js: https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js
justifiedGallery_css: https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css
# flickr-justified-gallery
flickr_justified_gallery_js:
flickr_justified_gallery_css:

# aplayer
aplayer_css: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css
aplayer_js: https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js
meting_js: https://cdn.jsdelivr.net/gh/metowolf/MetingJS@1.2/dist/Meting.min.js
aplayer_css:
aplayer_js:
meting_js:

# Prism.js
prismjs_js: https://cdn.jsdelivr.net/npm/prismjs/prism.min.js
prismjs_lineNumber_js: https://cdn.jsdelivr.net/npm/prismjs/plugins/line-numbers/prism-line-numbers.min.js
prismjs_autoloader: https://cdn.jsdelivr.net/npm/prismjs/plugins/autoloader/prism-autoloader.min.js
prismjs_js:
prismjs_lineNumber_js:
prismjs_autoloader:
2 changes: 0 additions & 2 deletions languages/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ share: Share

rightside:
readmode_title: Read Mode
font_plus_title: Increase font size
font_minus_title: Decrease font size
translate_title: Toggle Between Traditional Chinese And Simplified Chinese
night_mode_title: Toggle Between Light And Dark Mode
back_to_top: Back To Top
Expand Down
2 changes: 0 additions & 2 deletions languages/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ share: Share

rightside:
readmode_title: Read Mode
font_plus_title: Increase font size
font_minus_title: Decrease font size
translate_title: Switch Between Traditional Chinese And Simplified Chinese
night_mode_title: Switch Between Light And Dark Mode
back_to_top: Back To Top
Expand Down
2 changes: 0 additions & 2 deletions languages/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ share: 分享

rightside:
readmode_title: 阅读模式
font_plus_title: 放大字体
font_minus_title: 缩小字体
translate_title: 简繁转换
night_mode_title: 浅色和深色模式转换
back_to_top: 回到顶部
Expand Down
2 changes: 0 additions & 2 deletions languages/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ share: 分享

rightside:
readmode_title: 閱讀模式
font_plus_title: 放大字型
font_minus_title: 縮小字型
translate_title: 簡繁轉換
night_mode_title: 淺色和深色模式轉換
back_to_top: 回到頂部
Expand Down
2 changes: 1 addition & 1 deletion layout/includes/head.pug
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

meta(charset='UTF-8')
meta(http-equiv="X-UA-Compatible" content="IE=edge")
meta(name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no")
meta(name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no")
title= tabTitle
if pageKeywords
meta(name="keywords" content=pageKeywords)
Expand Down
12 changes: 0 additions & 12 deletions layout/includes/head/analytics.pug
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,6 @@ if theme.google_analytics
gtag('js', new Date());
gtag('config', '!{theme.google_analytics}');

if theme.tencent_analytics
script.
var _mtac = {};
(function() {
var mta = document.createElement("script");
mta.src = "//pingjs.qq.com/h5/stats.js?v2.0.4";
mta.setAttribute("name", "MTAH5");
mta.setAttribute("sid", "!{theme.tencent_analytics}");
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(mta, s);
})();

if theme.cnzz_analytics
script(async data-pjax src=`https://s4.cnzz.com/z_stat.php?id=${theme.cnzz_analytics}&web_id=${theme.cnzz_analytics}`)

Expand Down
5 changes: 2 additions & 3 deletions layout/includes/head/config.pug
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ script.
lightbox: '!{ theme.medium_zoom ? "mediumZoom" : (theme.fancybox ? "fancybox" : "null" )}',
Snackbar: !{Snackbar},
source: {
jQuery: '!{url_for(theme.CDN.jquery)}',
justifiedGallery: {
js: '!{url_for(theme.CDN.justifiedGallery_js)}',
css: '!{url_for(theme.CDN.justifiedGallery_css)}'
js: '!{url_for(theme.CDN.flickr_justified_gallery_js)}',
css: '!{url_for(theme.CDN.flickr_justified_gallery_css)}'
}
},
isPhotoFigcaption: !{theme.photofigcaption},
Expand Down
3 changes: 0 additions & 3 deletions layout/includes/head/preconnect.pug
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ if theme.google_analytics
if theme.baidu_analytics
link(rel="preconnect" href="//hm.baidu.com")

if theme.tencent_analytics
link(rel="preconnect" href="//pingjs.qq.com")

if theme.cnzz_analytics
link(rel="preconnect" href="//s4.cnzz.com")

Expand Down
10 changes: 5 additions & 5 deletions layout/includes/mixins/post-ui.pug
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ mixin postUI(posts)
time(datetime=date_xml(article[date_type]) title=date_title + ' ' + full_date(article[date_type]))=date(article[date_type], config.date_format)
if (theme.post_meta.page.categories && article.categories.data.length > 0)
span.article-meta
span.article-meta__separator |
span.article-meta-separator |
i.fas.fa-inbox
each item, index in article.categories.data
a(href=url_for(item.path)).article-meta__categories #[=item.name]
if (index < article.categories.data.length - 1)
i.fas.fa-angle-right
i.fas.fa-angle-right.article-meta-link
if (theme.post_meta.page.tags && article.tags.data.length > 0)
span.article-meta.tags
span.article-meta__separator |
span.article-meta-separator |
i.fas.fa-tag
each item, index in article.tags.data
a(href=url_for(item.path)).article-meta__tags #[=item.name]
if (index < article.tags.data.length - 1)
span.article-meta__link #[='']
span.article-meta-link #[='']

mixin countBlockInIndex
- needLoadCountJs = true
span.article-meta
span.article-meta__separator |
span.article-meta-separator |
i.fas.fa-comments
if block
block
Expand Down
Loading

0 comments on commit cb82bfb

Please sign in to comment.