mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
2. Feature: 可設置夜間模式作爲默認樣式 3. Feature: 可設置是否顯示code language名稱 4. Feature: 可設置是否展開或關閉代碼框 5. Feature: 可設置背景圖片/顔色 6. Feature: 可設置是否顯示footer背景 7. Feature: 增加 canvas-nest.js 8. Feature: 頭像可設置效果(轉圈圈) 9. Feature: menu可設置分組 9. Fix: 優化打賞和搜索打開特效 10. Fix: 優化sidebar的打開特效,避免與文章頁特效不同步 11. Fix: 適配**hexo-blog-encrypt**,現在可以顯示toc 12. Fix: 修復設置不顯示評論時,直達評論按鈕沒有消失的bug 13. Fix: 修復post頁底欄,當沒有顯示評論,不顯示TOC,評論和toc都不顯示 這三種狀態下按鈕的bug 14. Fix: 修復代碼框左右滑動時,代碼名字跟著滑動的bug 15. Fix: 其他page頁標題的字體顯示 16. Fix: 修復當設置開啓canvas_ribbons,進入網站會先顯示canvas_ribbons的bug 17. Fix: 完善夜間模式下,字體顯示問題 18. Fix: 修復代碼框 複製 和 代碼名 z-index bug #25 19. Fix: 完善阅读模式
93 lines
3.6 KiB
Plaintext
93 lines
3.6 KiB
Plaintext
|
||
- var pageTitle = page.title || config.subtitle || ''
|
||
- if (is_archive()) pageTitle = _p('page.archives')
|
||
- if (is_tag()) pageTitle = _p('page.tag') + ': ' + page.tag
|
||
- if (is_category()) pageTitle = _p('page.category') + ': ' + page.category
|
||
- if (is_month()) pageTitle += ': ' + page.month + '/' + page.year
|
||
- if (is_year()) pageTitle += ': ' + page.year
|
||
- var pageTitle_saved //- 暫時存儲pageTitle
|
||
- var pageTitle_no_include_blog_name //- 存儲pageTitle, 不帶 " | ",meta用
|
||
- var home_subtitle_true //有subtitle
|
||
//- home時顯示config.title (JerryC),其他顯示 pageTitle。meta用
|
||
- is_home() ? pageTitle_no_include_blog_name = config.title : pageTitle_no_include_blog_name = pageTitle
|
||
//- 暫時存儲pageTitle
|
||
- pageTitle ? pageTitle_saved = pageTitle + ' | ' + config.title : pageTitle_saved = config.title
|
||
//- 是否有 config.subtitle 是各自显示
|
||
- config.subtitle ? home_subtitle_true = ' - ' + config.subtitle : home_subtitle_true = ''
|
||
//- home時pageTitle顯示 JerryC - subtitle,其他顯示 pageTitle | JerryC
|
||
- is_home() ? pageTitle = config.title + home_subtitle_true : pageTitle = pageTitle_saved
|
||
|
||
- var pageDescription = page.description || page.title || config.description || ''
|
||
- var pageKeywords = (config.keywords || []).join(',')
|
||
- if (page.tags && page.tags.data) pageKeywords = page.tags.data.map(function(tag) {return tag.name;}).join(',')
|
||
- var pageAuthor = config.email ? config.author + ',' + config.email : config.author
|
||
- var pageCopyright = config.copyright || config.author
|
||
- var body_class = theme.display_mode == 'night' ? 'night-mode' : ''
|
||
|
||
|
||
doctype html
|
||
html(lang=config.language)
|
||
head
|
||
meta(charset='UTF-8')
|
||
meta(http-equiv="X-UA-Compatible" content="IE=edge")
|
||
meta(name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1")
|
||
title= pageTitle
|
||
meta(name="description" content=pageDescription)
|
||
meta(name="keywords" content=pageKeywords)
|
||
meta(name="author" content=pageAuthor)
|
||
meta(name="copyright" content=pageCopyright)
|
||
meta(name ="format-detection" content="telephone=no")
|
||
!=favicon_tag(config.favicon || theme.favicon || '/favicon.ico')
|
||
if theme.stylesheets !== undefined && theme.stylesheets.length > 0
|
||
each url in theme.stylesheets
|
||
link(rel='stylesheet', href=url_for(url))
|
||
each item in theme.cdn.css
|
||
if item !== undefined
|
||
link(rel='stylesheet', href=item)
|
||
include ./head.pug
|
||
include ./config.pug
|
||
body(class=body_class)
|
||
if theme.fireworks && theme.fireworks.enable
|
||
canvas.fireworks
|
||
if theme.background
|
||
#web_bg
|
||
if (is_post() && page.toc != false && theme.toc.enable)
|
||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true")
|
||
include ./sidebar.pug
|
||
if (!is_post())
|
||
include ./nav.pug
|
||
#content-outer
|
||
block top_img
|
||
if (!is_post())
|
||
#content-inner.layout_page
|
||
if body
|
||
div!= body
|
||
else
|
||
block content
|
||
else
|
||
#content-inner.layout.layout_post
|
||
if body
|
||
div!= body
|
||
else
|
||
block content
|
||
|
||
- var footer_bg = theme.footer_bg == false ? '' : bg_img
|
||
footer(style=footer_bg)
|
||
include ./footer.pug
|
||
i.fa.fa-arrow-up#go-up(aria-hidden="true")
|
||
include ./rightside.pug
|
||
if (is_post())
|
||
include ./post-bottom.pug
|
||
each item in theme.cdn.js
|
||
if item !== undefined
|
||
script(src=url_for(item))
|
||
if theme.scripts !== undefined && theme.scripts.length > 0
|
||
//- scripts list from config.yml
|
||
each url in theme.scripts
|
||
script(src=url_for(url))
|
||
include ./additional-js.pug
|
||
include ./search/index.pug
|
||
|
||
|
||
|