mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-03 22:22:00 +08:00
feat: 修改 toc 打開效果
feat: 適配 hexo-blog-encrypt fix: 修復 hexo 新版本下,prismjs 的問題 improvement: 在 pjax 關閉的情況下。減少不必要的全局變量 improvement: 更新依賴版本 improvement: 頁面進入效果優化 improvement: 添加平滑滾動 improvement: 兼容性優化 improvement: 優化 lighthouse 分數 improvement: 優化代碼
This commit is contained in:
1 parent
ee6b137e94
commit
9e0dce6c7a
41 files changed
+601
-536
No files matched your search
@@ -48,6 +48,8 @@ if (theme.snackbar && theme.snackbar.enable)
|
|||||||
if theme.fancybox
|
if theme.fancybox
|
||||||
link(rel='stylesheet' href=url_for(theme.asset.fancybox_css) media="print" onload="this.media='all'")
|
link(rel='stylesheet' href=url_for(theme.asset.fancybox_css) media="print" onload="this.media='all'")
|
||||||
|
|
||||||
|
!=fragment_cache('injectHeadJs', function(){return inject_head_js()})
|
||||||
|
|
||||||
//- google_adsense
|
//- google_adsense
|
||||||
!=partial('includes/head/google_adsense', {}, {cache: true})
|
!=partial('includes/head/google_adsense', {}, {cache: true})
|
||||||
|
|
||||||
@@ -63,6 +65,4 @@ if theme.blog_title_font && theme.blog_title_font.font_link
|
|||||||
|
|
||||||
include ./head/config_site.pug
|
include ./head/config_site.pug
|
||||||
|
|
||||||
!=fragment_cache('injectHeadJs', function(){return inject_head_js()})
|
|
||||||
|
|
||||||
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||||
@@ -7,14 +7,20 @@ if theme.baidu_analytics
|
|||||||
var s = document.getElementsByTagName("script")[0];
|
var s = document.getElementsByTagName("script")[0];
|
||||||
s.parentNode.insertBefore(hm, s);
|
s.parentNode.insertBefore(hm, s);
|
||||||
})();
|
})();
|
||||||
|
btf.addGlobalFn('pjaxComplete', () => {
|
||||||
|
_hmt.push(['_trackPageview',window.location.pathname])
|
||||||
|
}, 'baidu_analytics')
|
||||||
|
|
||||||
if theme.google_analytics
|
if theme.google_analytics
|
||||||
script(async src=`https://www.googletagmanager.com/gtag/js?id=${theme.google_analytics}`)
|
script(async src=`https://www.googletagmanager.com/gtag/js?id=${theme.google_analytics}`)
|
||||||
script.
|
script.
|
||||||
window.dataLayer = window.dataLayer || [];
|
window.dataLayer = window.dataLayer || []
|
||||||
function gtag(){dataLayer.push(arguments);}
|
function gtag(){dataLayer.push(arguments)}
|
||||||
gtag('js', new Date());
|
gtag('js', new Date())
|
||||||
gtag('config', '!{theme.google_analytics}');
|
gtag('config', '!{theme.google_analytics}')
|
||||||
|
btf.addGlobalFn('pjaxComplete', () => {
|
||||||
|
gtag('config', '!{theme.google_analytics}', {'page_path': window.location.pathname})
|
||||||
|
}, 'google_analytics')
|
||||||
|
|
||||||
if theme.cloudflare_analytics
|
if theme.cloudflare_analytics
|
||||||
script(defer data-pjax src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon=`{"token": "${theme.cloudflare_analytics}"}`)
|
script(defer data-pjax src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon=`{"token": "${theme.cloudflare_analytics}"}`)
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ if theme.menu
|
|||||||
.menus_item
|
.menus_item
|
||||||
- const labelArray = label.split('||')
|
- const labelArray = label.split('||')
|
||||||
- const hideClass = labelArray[2] && trim(labelArray[2]) === 'hide' ? 'hide' : ''
|
- const hideClass = labelArray[2] && trim(labelArray[2]) === 'hide' ? 'hide' : ''
|
||||||
a.site-page.group(class=`${hideClass}` href='javascript:void(0);')
|
span.site-page.group(class=`${hideClass}`)
|
||||||
if labelArray[1]
|
if labelArray[1]
|
||||||
i.fa-fw(class=trim(labelArray[1]))
|
i.fa-fw(class=trim(labelArray[1]))
|
||||||
span=' '+ trim(labelArray[0])
|
span=' '+ trim(labelArray[0])
|
||||||
|
|||||||
Loaded 3 of 41 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user