mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 19:50:55 +08:00
improvement: 首頁社交圖標左右邊距調整 feat: 文章版權增加圖標 improvement: 重構 main.js 代碼 improvement: 優化 pjax 下的性能 fix: 修復子目錄下,pjax 跳轉 404 錯誤 feat: getScript 增加 attribute 配置 improvement: 優化手機端 toc 打開和關閉特效 improvement: 文章進入特效改為 transform, 優化 stylus improvement: 目錄側邊欄出現滾動條時,元素不會被擠壓 feat: 文章左右對齊 improvement: 處理 waline 的 url 後面多 / 導致跨域的問題 fix: 修復夜間模式下,小屏幕的toc 滾動條顏色不明顯的 bug fix: 修復設置字體超過17px時,toc 裏面的邊框異常的 bug improvement: 優化語言文件部分用詞 improvement: disqus 和 disqusjs 的評論數獲取不到時,顯示為 0 improvement: disqusjs 的評論數改為 api 獲取 improvement: 代碼優化 improvement: 更新 plugins.yml
70 lines
2.8 KiB
Plaintext
70 lines
2.8 KiB
Plaintext
- var pageTitle
|
|
- is_archive() ? page.title = findArchivesTitle(page, theme.menu, date) : ''
|
|
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
|
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
|
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404')
|
|
- else pageTitle = page.title || config.title || ''
|
|
|
|
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
|
- var tabTitle = is_home() || !pageTitle ? config.title + isSubtitle : pageTitle + ' | ' + config.title
|
|
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
|
- var pageCopyright = config.copyright || config.author
|
|
- var themeColorLight = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_light || '#ffffff'
|
|
- var themeColorDark = theme.theme_color && theme.theme_color.enable && theme.theme_color.meta_theme_color_dark || '#0d0d0d'
|
|
- var themeColor = theme.display_mode === 'dark' ? themeColorDark : themeColorLight
|
|
|
|
meta(charset='UTF-8')
|
|
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
|
meta(name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover")
|
|
title= tabTitle
|
|
meta(name="author" content=pageAuthor)
|
|
meta(name="copyright" content=pageCopyright)
|
|
meta(name ="format-detection" content="telephone=no")
|
|
meta(name="theme-color" content=themeColor)
|
|
|
|
//- Open_Graph
|
|
include ./head/Open_Graph.pug
|
|
|
|
!=favicon_tag(theme.favicon || config.favicon)
|
|
link(rel="canonical" href=urlNoIndex(null,config.pretty_urls.trailing_index,config.pretty_urls.trailing_html))
|
|
|
|
//- 預解析
|
|
!=partial('includes/head/preconnect', {}, {cache: true})
|
|
|
|
//- 網站驗證
|
|
!=partial('includes/head/site_verification', {}, {cache: true})
|
|
|
|
//- PWA
|
|
if (theme.pwa && theme.pwa.enable)
|
|
!=partial('includes/head/pwa', {}, {cache: true})
|
|
|
|
//- main css
|
|
link(rel='stylesheet', href=url_for(theme.asset.main_css))
|
|
link(rel='stylesheet', href=url_for(theme.asset.fontawesome) media="print" onload="this.media='all'")
|
|
|
|
if (theme.snackbar && theme.snackbar.enable)
|
|
link(rel='stylesheet', href=url_for(theme.asset.snackbar_css) media="print" onload="this.media='all'")
|
|
|
|
if theme.fancybox
|
|
link(rel='stylesheet' href=url_for(theme.asset.fancybox_css) media="print" onload="this.media='all'")
|
|
|
|
//- google_adsense
|
|
!=partial('includes/head/google_adsense', {}, {cache: true})
|
|
|
|
//- analytics
|
|
!=partial('includes/head/analytics', {}, {cache: true})
|
|
|
|
//- font
|
|
if theme.blog_title_font && theme.blog_title_font.font_link
|
|
link(rel='stylesheet' href=url_for(theme.blog_title_font.font_link) media="print" onload="this.media='all'")
|
|
|
|
//- global config
|
|
!=partial('includes/head/config', {}, {cache: true})
|
|
|
|
include ./head/config_site.pug
|
|
include ./head/noscript.pug
|
|
|
|
!=fragment_cache('injectHeadJs', function(){return inject_head_js()})
|
|
|
|
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|