hexo-theme-butterfly/layout/includes/layout.pug
Jerry 082df56112 1. 完善gitalk 在 dark mode下的顯示
2. 完善footer 有背景和無背景下,在dark mode下的顯示
3. 界面微調
4. 增加選項可關閉aside在手機上的顯示
5. 修復關閉夜間模式情況下,console報Uncaught ReferenceError: autoChangeMode is not defined 的bug
2019-11-08 22:25:00 +08:00

84 lines
3.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- 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
doctype html
html(lang=config.language data-theme=theme.display_mode)
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')
include ./head.pug
include ./config.pug
body
if theme.fireworks && theme.fireworks.enable
canvas.fireworks
include ./header.pug
include ./mobile-sidebar.pug
#body-wrap
if theme.background
- var source = theme.background
- var is_photo = source.substring(3,0) === 'url' ? 'photo':'color'
#web_bg(data-type=is_photo)
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
- var is_bg = theme.footer_bg == false ? 'color' : 'photo'
footer#footer(style=footer_bg data-type=is_bg)
include ./footer.pug
include ./rightside.pug
each item in theme.CDN_USE.js
script(src=url_for(item))
include ./additional-js.pug
include ./search/index.pug