mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
1. 更改手機頁面的menu和toc的顯示方式和顯示特效(ipad也能看TOC) 3. 可設置複製時,内容自動加上版權信息 4. 可修改tag的top_img 5. 可修改category的top_img 6. 可修改valine的背景 7. archives頁UI優化 8. ICP增加icon #37 9. 可設置主頁top_img的高度 10. 可設置主頁site-info的位置 11. category頁和tag頁的UI可以設置與主頁UI一樣 #31 12. 主頁subtitle可設置多個句子(不再限制2個) #37 13. 設置menu時,頭尾添加空格不受影響 14. 調整post頁的佈局 15. 书签添加icon 16. 公告icon效果 17. 首頁歸檔模塊,可設置數量限制,會顯示'查看更多'按鈕 18. 右下角按鈕調整。 19. 修复文章cover隨機图片生成,同一篇文章,不同地方的cover顯示不一样的bug 20. 修復gitalk語言設置無效的bug #35 21. 修復post頁面,當沒有設置word count時,閲讀量前有'|" 22. 修复sub-menu在safari的显示问题 23. 修复tags页评论居中问题 24. 修复header a hover 白色问题 25. 修復夜間模式下footer的顔色bug 26. 修復英文語言下,書簽英文顯示不完整的問題
94 lines
3.7 KiB
Plaintext
94 lines
3.7 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
|
||
//- 判断keywords
|
||
|
||
- var pageDescription = page.description || page.title || config.description || ''
|
||
- var pageKeywords = Array.isArray(config.keywords) ? (config.keywords).join(','): ([]).join(',') || config.keywords
|
||
- 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
|
||
include ./header.pug
|
||
include ./mobile-sidebar.pug
|
||
#body-wrap
|
||
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
|
||
include ./rightside.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
|
||
|
||
|
||
|