mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-10 21:17:07 +08:00
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 顯示正常
79 lines
3.3 KiB
Plaintext
79 lines
3.3 KiB
Plaintext
- var pageTitle
|
||
- if (is_archive()) pageTitle = fragment_cache('findArchivesTitle', function(){return findArchivesTitle(theme.menu);})
|
||
- else if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||
- else if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||
- else if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||
- else if (is_year()) pageTitle += ': ' + page.year
|
||
- 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 pageKeywords
|
||
- if (page.keywords) pageKeywords = Array.isArray(page.keywords) ? (page.keywords).join(',') : ([]).join(',') || page.keywords
|
||
- else if (page.tags && page.tags.length) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||
- else pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||
- var pageCopyright = config.copyright || config.author
|
||
- var themeColor = theme.display_mode === 'dark' ? '#0d0d0d' : '#ffffff'
|
||
|
||
meta(charset='UTF-8')
|
||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||
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)
|
||
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())
|
||
|
||
//- 預解析
|
||
!=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.CDN.main_css))
|
||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome) media="print" onload="this.media='all'")
|
||
|
||
if (theme.snackbar && theme.snackbar.enable)
|
||
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css) media="print" onload="this.media='all'")
|
||
|
||
if theme.algolia_search.enable
|
||
link(rel='stylesheet' href=url_for(theme.CDN.algolia_search_css) media="print" onload="this.media='all'")
|
||
|
||
if theme.fancybox
|
||
link(rel='stylesheet' href=url_for(theme.CDN.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)}) |