feat: 可設置首頁文章不顯示內容/description
feat: 主頁文章時間和文章頁文章時間可以配置顯示日期還是相對時間 feat: top_img 可配置 [留空(默認色)/顏色/漸變色/圖片鏈接/ false(不顯示top_img)] feat: footer可配置背景 [留空/false(默認色)/顏色/漸變色/圖片鏈接/true(跟top_img一樣)] improvement: preloader 在 pjax 下 每個頁面都會加載 improvement: 修改判斷,避免用户設置2個lightbox 而導致報錯(只能設置一個) improvement: 精確時間顯示 (剛剛/幾分鐘前/幾小時前/幾天前/幾個月前) improvement: 刪除不必要的語言文件和css chore: update hexo-renderer-stylus to 2.0.1pull/353/head
parent
8603db0545
commit
25b0c733dc
@ -1,12 +1,11 @@
|
||||
- var contentType = is_post() ? 'article' : 'website'
|
||||
|
||||
if theme.Open_Graph_meta
|
||||
meta(property="og:type" content=contentType)
|
||||
meta(property="og:title" content=pageTitle)
|
||||
meta(property="og:url" content=urlNoIndex())
|
||||
meta(property="og:site_name" content=config.title)
|
||||
meta(property="og:description" content!=pageDescription)
|
||||
meta(property="og:image" content=full_url_for(page.cover || theme.avatar.img))
|
||||
meta(property="article:published_time" content=date_xml(page.date))
|
||||
meta(property="article:modified_time" content=date_xml(page.updated))
|
||||
meta(name="twitter:card" content="summary")
|
||||
- let contentType = is_post() ? 'article' : 'website'
|
||||
- let metaImage = full_url_for(page.cover || theme.avatar.img)
|
||||
- let fb_appId = theme.facebook_comments.app_id || ''
|
||||
- let fb_admins = theme.facebook_comments.user_id || ''
|
||||
|
||||
!= open_graph({type: contentType, image: metaImage, fb_admins: fb_admins, fb_app_id: fb_appId})
|
||||
|
||||
else
|
||||
meta(name="description" content=page_description())
|
||||
|
||||
|
@ -1,9 +1,14 @@
|
||||
noscript.
|
||||
<style type="text/css">
|
||||
#nav {
|
||||
opacity: 1
|
||||
}
|
||||
.justified-gallery img {
|
||||
opacity: 1
|
||||
}
|
||||
#nav {
|
||||
opacity: 1
|
||||
}
|
||||
.justified-gallery img {
|
||||
opacity: 1
|
||||
}
|
||||
|
||||
#recent-posts time,
|
||||
#post-meta time {
|
||||
display: inline !important
|
||||
}
|
||||
</style>
|
@ -1,43 +1,60 @@
|
||||
if is_home()
|
||||
- var top_img = theme.index_img || theme.default_top_img
|
||||
else if is_post()
|
||||
- var top_img = page.top_img || page.cover || page.randomcover || theme.default_top_img
|
||||
else if is_archive()
|
||||
- var top_img = theme.archive_img || theme.default_top_img
|
||||
else if is_tag()
|
||||
- var top_img = theme.tag_img || theme.default_top_img
|
||||
else if is_category()
|
||||
- var top_img = theme.category_img || theme.default_top_img
|
||||
else
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
if page.top_img !== false
|
||||
if is_post()
|
||||
- var top_img = page.top_img || page.cover || page.randomcover || theme.default_top_img
|
||||
else if is_page()
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
else if is_tag()
|
||||
- var top_img = theme.tag_per_img && theme.tag_per_img[page.tag]
|
||||
- top_img = top_img ? top_img : (theme.tag_img !== false ? theme.tag_img || theme.default_top_img : false)
|
||||
else if is_category()
|
||||
- var top_img = theme.category_per_img && theme.category_per_img[page.category]
|
||||
- top_img = top_img ? top_img : (theme.category_img !== false ? theme.category_img || theme.default_top_img : false)
|
||||
else if is_home()
|
||||
- var top_img = theme.index_img !== false ? theme.index_img || theme.default_top_img : false
|
||||
else if is_archive()
|
||||
- var top_img = theme.archive_img !== false ? theme.archive_img || theme.default_top_img : false
|
||||
else
|
||||
- var top_img = page.top_img || theme.default_top_img
|
||||
|
||||
if theme.douban
|
||||
if is_current('/movies/', [strict])
|
||||
- var top_img = theme.douban.movies_img || theme.default_top_img
|
||||
else if is_current('/books/', [strict])
|
||||
- var top_img = theme.douban.books_img || theme.default_top_img
|
||||
else if is_current('/games/', [strict])
|
||||
- var top_img = theme.douban.games_img || theme.default_top_img
|
||||
if theme.douban
|
||||
- var doubanExist = false
|
||||
if is_current('/movies/', [strict])
|
||||
- var top_img = theme.douban.movies_img !== false ? theme.douban.movies_img || theme.default_top_img : false
|
||||
- doubanExist = true
|
||||
else if is_current('/books/', [strict])
|
||||
- var top_img = theme.douban.books_img !== false ? theme.douban.books_img || theme.default_top_img : false
|
||||
- doubanExist = true
|
||||
else if is_current('/games/', [strict])
|
||||
- var top_img = theme.douban.games_img !== false ? theme.douban.games_img || theme.default_top_img : false
|
||||
- doubanExist = true
|
||||
|
||||
- var bg_img = top_img && top_img !== true ? `background-image: url(${url_for(top_img)})` : ''
|
||||
- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
|
||||
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
|
||||
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||
if top_img !== false
|
||||
- var imgSource = top_img && top_img.indexOf('/') !== -1 ? `background-image: url(${url_for(top_img)})` : `background: ${top_img}`
|
||||
- var bg_img = top_img ? imgSource : ''
|
||||
- var site_title = is_archive() ? _p('page.archives') : page.title || page.tag || page.category || config.title
|
||||
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
|
||||
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||
else
|
||||
- var isHomeClass = 'no-top-img'
|
||||
else
|
||||
- var top_img = false
|
||||
- var isHomeClass = 'no-top-img'
|
||||
|
||||
header#page-header(class=isHomeClass style=bg_img)
|
||||
!=partial('includes/header/nav', {}, {cache:theme.fragment_cache})
|
||||
if is_home()
|
||||
#site-info
|
||||
h1#site_title=site_title
|
||||
#site_subtitle
|
||||
span#subtitle
|
||||
if(theme.social)
|
||||
#site_social_icons
|
||||
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||
#scroll_down
|
||||
i.fas.fa-angle-down.scroll-down-effects
|
||||
else if is_post()
|
||||
include ./post-info.pug
|
||||
else
|
||||
#page_site-info
|
||||
h1#site_title=site_title
|
||||
if top_img !== false
|
||||
if is_post()
|
||||
include ./post-info.pug
|
||||
else if is_home()
|
||||
#site-info
|
||||
h1#site_title=site_title
|
||||
#site_subtitle
|
||||
span#subtitle
|
||||
if(theme.social)
|
||||
#site_social_icons
|
||||
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||
#scroll_down
|
||||
i.fas.fa-angle-down.scroll-down-effects
|
||||
else
|
||||
#page_site-info
|
||||
h1#site_title=site_title
|
||||
|
@ -1,6 +1,13 @@
|
||||
script.
|
||||
var endLoading = function () {
|
||||
document.body.style.overflow = 'auto';
|
||||
document.getElementById('loading-box').classList.add("loaded")
|
||||
var preloader = {
|
||||
endLoading: () => {
|
||||
document.body.style.overflow = 'auto';
|
||||
document.getElementById('loading-box').classList.add("loaded")
|
||||
},
|
||||
initLoading: () => {
|
||||
document.body.style.overflow = '';
|
||||
document.getElementById('loading-box').classList.remove("loaded")
|
||||
|
||||
}
|
||||
}
|
||||
window.addEventListener('load',endLoading)
|
||||
window.addEventListener('load',()=> {preloader.endLoading()})
|
Loading…
Reference in New Issue