mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
This commit is contained in:
@@ -5,10 +5,10 @@ script(src=url_for(theme.CDN.main))
|
||||
if theme.translate && theme.translate.enable
|
||||
script(src=url_for(theme.CDN.translate))
|
||||
|
||||
if (theme.medium_zoom && theme.medium_zoom.enable)
|
||||
if theme.medium_zoom
|
||||
script(src=url_for(theme.CDN.medium_zoom))
|
||||
|
||||
if (theme.fancybox && theme.fancybox.enable)
|
||||
if theme.fancybox
|
||||
script(src=url_for(theme.CDN.fancybox))
|
||||
|
||||
include ./math/index.pug
|
||||
@@ -39,14 +39,14 @@ if theme.activate_power_mode.enable
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async src=url_for(theme.CDN.busuanzi))
|
||||
|
||||
if theme.instantpage.enable
|
||||
script(src=url_for(theme.CDN.instantpage) type="module")
|
||||
if theme.instantpage
|
||||
script(src=url_for(theme.CDN.instantpage) type="module" defer)
|
||||
|
||||
if theme.lazyload
|
||||
script(src=url_for(theme.CDN.lazyload))
|
||||
if theme.lazyload.enable
|
||||
script(src=url_for(theme.CDN.lazyload) async)
|
||||
|
||||
//- 鼠標特效
|
||||
if theme.click_heart && theme.click_heart.enable
|
||||
if theme.click_heart
|
||||
script(src=url_for(theme.CDN.click_heart))
|
||||
|
||||
if theme.ClickShowText && theme.ClickShowText.enable
|
||||
@@ -71,4 +71,6 @@ if is_home()
|
||||
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading-js', {}, {cache:theme.fragment_cache})
|
||||
!=partial('includes/loading/loading-js', {}, {cache:theme.fragment_cache})
|
||||
|
||||
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache})
|
||||
|
||||
30
layout/includes/chat/chatra.pug
Normal file
30
layout/includes/chat/chatra.pug
Normal file
@@ -0,0 +1,30 @@
|
||||
//- https://chatra.io/help/api/
|
||||
script.
|
||||
(function(d, w, c) {
|
||||
w.ChatraID = '#{theme.chatra.id}';
|
||||
var s = d.createElement('script');
|
||||
w[c] = w[c] || function() {
|
||||
(w[c].q = w[c].q || []).push(arguments);
|
||||
};
|
||||
s.async = true;
|
||||
s.src = 'https://call.chatra.io/chatra.js';
|
||||
if (d.head) d.head.appendChild(s);
|
||||
})(document, window, 'Chatra');
|
||||
|
||||
if (!{theme.chat_btn}) {
|
||||
var chatBtn = document.getElementById("chat_btn")
|
||||
chatBtn.addEventListener("click", function(){
|
||||
Chatra('openChat')
|
||||
});
|
||||
} else {
|
||||
if (!{theme.chat_hide_show}) {
|
||||
function chatBtnHide () {
|
||||
Chatra('hide')
|
||||
}
|
||||
function chatBtnShow () {
|
||||
Chatra('show')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
37
layout/includes/chat/daovoice.pug
Normal file
37
layout/includes/chat/daovoice.pug
Normal file
@@ -0,0 +1,37 @@
|
||||
//- https://guide.daocloud.io/daovoice/javascript-api-5869833.html
|
||||
script.
|
||||
(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/!{theme.daovoice.app_id}.js","daovoice")
|
||||
|
||||
script.
|
||||
var isChatBtn = !{theme.chat_btn}
|
||||
daovoice('init', {
|
||||
app_id: '!{theme.daovoice.app_id}',},{
|
||||
launcher: {
|
||||
disableLauncherIcon: isChatBtn // 悬浮 ICON 是否显示
|
||||
},
|
||||
});
|
||||
daovoice('update');
|
||||
|
||||
if (isChatBtn) {
|
||||
var chatBtn = document.getElementById("chat_btn")
|
||||
chatBtn.addEventListener("click", function(){
|
||||
daovoice('show')
|
||||
});
|
||||
} else {
|
||||
if (!{theme.chat_hide_show}) {
|
||||
function chatBtnHide () {
|
||||
daovoice('update', {},{
|
||||
launcher: {
|
||||
disableLauncherIcon: true // 悬浮 ICON 是否显示
|
||||
},
|
||||
});
|
||||
}
|
||||
function chatBtnShow () {
|
||||
daovoice('update', {},{
|
||||
launcher: {
|
||||
disableLauncherIcon: false // 悬浮 ICON 是否显示
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
28
layout/includes/chat/gitter.pug
Normal file
28
layout/includes/chat/gitter.pug
Normal file
@@ -0,0 +1,28 @@
|
||||
//- https://sidecar.gitter.im/
|
||||
script.
|
||||
var isChatBtn = !{theme.chat_btn}
|
||||
|
||||
if (isChatBtn) {
|
||||
((window.gitter = {}).chat = {}).options = {
|
||||
room: '#{theme.gitter.room}',
|
||||
activationElement: '#chat_btn'
|
||||
};
|
||||
} else {
|
||||
((window.gitter = {}).chat = {}).options = {
|
||||
room: '#{theme.gitter.room}',
|
||||
};
|
||||
|
||||
if (!{theme.chat_hide_show}) {
|
||||
var gitterBtn = document.getElementsByClassName('gitter-open-chat-button')
|
||||
|
||||
function chatBtnHide () {
|
||||
gitterBtn[0].style.display= 'none'
|
||||
}
|
||||
|
||||
function chatBtnShow () {
|
||||
gitterBtn[0].style.display= 'block'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)
|
||||
8
layout/includes/chat/index.pug
Normal file
8
layout/includes/chat/index.pug
Normal file
@@ -0,0 +1,8 @@
|
||||
if theme.chatra && theme.chatra.enable
|
||||
include ./chatra.pug
|
||||
else if theme.tidio && theme.tidio.enable
|
||||
include ./tidio.pug
|
||||
else if theme.daovoice && theme.daovoice.enable
|
||||
include ./daovoice.pug
|
||||
else if theme.gitter && theme.gitter.enable
|
||||
include ./gitter.pug
|
||||
39
layout/includes/chat/tidio.pug
Normal file
39
layout/includes/chat/tidio.pug
Normal file
@@ -0,0 +1,39 @@
|
||||
script(src=`//code.tidio.co/${theme.tidio.public_key}.js` async)
|
||||
|
||||
if theme.chat_btn
|
||||
script.
|
||||
(function() {
|
||||
function onTidioChatApiReady() {
|
||||
window.tidioChatApi.hide();
|
||||
window.tidioChatApi.on("close", function() {
|
||||
window.tidioChatApi.hide();
|
||||
});
|
||||
}
|
||||
if (window.tidioChatApi) {
|
||||
window.tidioChatApi.on("ready", onTidioChatApiReady);
|
||||
} else {
|
||||
document.addEventListener("tidioChat-ready", onTidioChatApiReady);
|
||||
}
|
||||
|
||||
document.getElementById("chat_btn").addEventListener("click", function(){
|
||||
window.tidioChatApi.show();
|
||||
window.tidioChatApi.open();
|
||||
});
|
||||
})();
|
||||
else if theme.chat_hide_show
|
||||
script.
|
||||
function chatBtnHide () {
|
||||
if (window.tidioChatApi) {
|
||||
window.tidioChatApi.hide();
|
||||
//- document.getElementById('tidio-chat').style.display= 'none'
|
||||
}
|
||||
}
|
||||
|
||||
function chatBtnShow () {
|
||||
if (window.tidioChatApi) {
|
||||
window.tidioChatApi.show();
|
||||
//- document.getElementById('tidio-chat').style.display= 'block'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,13 @@ script(src=url_for(theme.CDN.disqusjs))
|
||||
script.
|
||||
var dsqjs = new DisqusJS({
|
||||
shortname: '!{theme.disqusjs.shortname}',
|
||||
siteName: "!{theme.disqusjs.siteName}",
|
||||
siteName: '!{theme.disqusjs.siteName}',
|
||||
identifier: '!{ page.path }',
|
||||
url: '!{ page.permalink }',
|
||||
title: '!{ page.title }',
|
||||
api: '!{theme.disqusjs.api}',
|
||||
apikey: '!{theme.disqusjs.apikey}',
|
||||
nocomment: '!{theme.disqusjs.nocomment}',
|
||||
admin: '!{theme.disqusjs.admin}',
|
||||
adminLabel: '!{theme.disqusjs.adminLabel}'
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
- var d = theme.disqus && theme.disqus.enable
|
||||
- var dj = theme.disqusjs && theme.disqusjs.enable
|
||||
- var l = theme.laibili && theme.laibili.enable
|
||||
- var l = theme.livere && theme.livere.enable
|
||||
- var gt = theme.gitalk && theme.gitalk.enable
|
||||
- var v = theme.valine && theme.valine.enable
|
||||
- var u = theme.utterances && theme.utterances.enable
|
||||
@@ -11,14 +11,14 @@ if isComment
|
||||
hr
|
||||
#post-comment
|
||||
.comment_headling
|
||||
i.fa.fa-comments.fa-fw(aria-hidden="true")
|
||||
i.fas.fa-comments.fa-fw
|
||||
span= ' ' + _p('comment')
|
||||
if d
|
||||
include ./disqus.pug
|
||||
else if dj
|
||||
include ./disqusjs.pug
|
||||
else if l
|
||||
include ./laibili.pug
|
||||
include ./livere.pug
|
||||
else if gt
|
||||
include ./gitalk.pug
|
||||
else if v
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#lv-container(data-id="city" data-uid=theme.laibili.uid)
|
||||
#lv-container(data-id="city" data-uid=theme.livere.uid)
|
||||
script.
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
@@ -15,14 +15,12 @@ script.
|
||||
}
|
||||
|
||||
var guestInfo = requestSetting(['nick','mail','link'],'#{ theme.valine.guest_info }')
|
||||
var requiredFields = requestSetting(['nick','mail','link'],'#{ theme.valine.requiredFields }')
|
||||
var requiredFields = requestSetting(['nick','mail'],'#{ theme.valine.requiredFields }')
|
||||
|
||||
window.valine = new Valine({
|
||||
el:'#vcomment',
|
||||
appId: '#{theme.valine.appId}',
|
||||
appKey: '#{theme.valine.appKey}',
|
||||
notify: #{theme.valine.notify},
|
||||
verify: #{theme.valine.verify},
|
||||
placeholder: '#{theme.valine.placeholder}',
|
||||
avatar: '#{theme.valine.avatar}',
|
||||
meta: guestInfo,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
.copyright!= `©${theme.since} - ${nowYear} By ${config.author}`
|
||||
else
|
||||
.copyright!= `©${nowYear} By ${config.author}`
|
||||
if theme.footer_copyright.enable
|
||||
if theme.footer_copyright
|
||||
.framework-info
|
||||
span= _p('footer.driven') + ' '
|
||||
a(href='https://hexo.io')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
- 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('error_title')
|
||||
- else if (is_current('/404.html', [strict])) pageTitle = _p('error404.error_title')
|
||||
- else pageTitle = page.title || config.title || ''
|
||||
|
||||
- var isSubtitle = config.subtitle ? ' - ' + config.subtitle : ''
|
||||
@@ -29,6 +29,7 @@ meta(name="author" content=pageAuthor)
|
||||
meta(name="copyright" content=pageCopyright)
|
||||
meta(name ="format-detection" content="telephone=no")
|
||||
!=favicon_tag(theme.favicon || config.favicon)
|
||||
link(rel="canonical" href=urlNoIndex())
|
||||
|
||||
if theme.disable_baidu_transformation
|
||||
meta(http-equiv="Cache-Control" content="no-transform")
|
||||
@@ -39,7 +40,7 @@ if theme.douban
|
||||
meta(name="referrer" content="no-referrer")
|
||||
|
||||
//- 預解析
|
||||
!=partial('includes/head/dns_prefetch', {}, {cache:theme.fragment_cache})
|
||||
!=partial('includes/head/preconnect', {}, {cache:theme.fragment_cache})
|
||||
|
||||
//- 網站驗證
|
||||
!=partial('includes/head/site_verification', {}, {cache:theme.fragment_cache})
|
||||
@@ -51,28 +52,19 @@ include ./head/Open_Graph.pug
|
||||
if (theme.pwa && theme.pwa.enable)
|
||||
!=partial('includes/head/pwa', {}, {cache:theme.fragment_cache})
|
||||
|
||||
script(src=url_for(theme.CDN.js_cookies))
|
||||
|
||||
if theme.darkmode.enable
|
||||
!=partial('includes/head/darkmode', {}, {cache:theme.fragment_cache})
|
||||
|
||||
//- main css
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.main_css))
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome))
|
||||
|
||||
if theme.fontawesome_v5 && theme.fontawesome_v5.enable
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v5))
|
||||
else
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fontawesome_v4))
|
||||
|
||||
if (theme.fancybox && theme.fancybox.enable)
|
||||
if theme.fancybox
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.fancybox_css))
|
||||
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
link(rel='stylesheet', href=url_for(theme.CDN.snackbar_css))
|
||||
|
||||
if theme.canonical
|
||||
link(rel="canonical" href=urlNoIndex())
|
||||
|
||||
if is_post()
|
||||
if(page.prev)
|
||||
link(rel="prev" title=page.prev.title href=url_for(page.prev.permalink) )
|
||||
@@ -92,8 +84,9 @@ include ./head/comment.pug
|
||||
//- analytics
|
||||
!=partial('includes/head/analytics', {}, {cache:theme.fragment_cache})
|
||||
|
||||
//- font
|
||||
if theme.blog_title_font.font_link
|
||||
link(rel='stylesheet', href=url_for(theme.blog_title_font.font_link))
|
||||
link(rel='stylesheet' href=url_for(theme.blog_title_font.font_link))
|
||||
|
||||
//- global config
|
||||
!=partial('includes/head/config', {}, {cache:theme.fragment_cache})
|
||||
@@ -101,4 +94,7 @@ if theme.blog_title_font.font_link
|
||||
include ./head/config_site.pug
|
||||
include ./head/noscript.pug
|
||||
|
||||
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||
!=fragment_cache('injectHead', function(){return injectHtml(theme.inject.head)})
|
||||
|
||||
if page.aplayer
|
||||
include ./head/aplayer.pug
|
||||
@@ -1,13 +1,5 @@
|
||||
- var contentType = is_post() ? 'article' : 'website'
|
||||
|
||||
//- twitter meta
|
||||
if theme.twitter_meta
|
||||
meta(name="twitter:card" content="summary")
|
||||
meta(name="twitter:title" content=pageTitle)
|
||||
meta(name="twitter:description" content!=pageDescription)
|
||||
meta(name="twitter:image" content=full_url_for(page.cover || theme.avatar.img))
|
||||
|
||||
//- Open_Graph
|
||||
if theme.Open_Graph_meta
|
||||
meta(property="og:type" content=contentType)
|
||||
meta(property="og:title" content=pageTitle)
|
||||
@@ -17,3 +9,4 @@ if theme.Open_Graph_meta
|
||||
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")
|
||||
|
||||
3
layout/includes/head/aplayer.pug
Normal file
3
layout/includes/head/aplayer.pug
Normal file
@@ -0,0 +1,3 @@
|
||||
link(rel='stylesheet' href=url_for(theme.CDN.aplayer_css))
|
||||
script(src=url_for(theme.CDN.aplayer_js))
|
||||
script(src=url_for(theme.CDN.meting_js))
|
||||
@@ -31,7 +31,6 @@
|
||||
translate = JSON.stringify({
|
||||
defaultEncoding: theme.translate.defaultEncoding,
|
||||
translateDelay: theme.translate.translateDelay,
|
||||
cookieDomain: theme.translate.cookieDomain,
|
||||
msgToTraditionalChinese: theme.translate.msgToTraditionalChinese,
|
||||
msgToSimplifiedChinese: theme.translate.msgToSimplifiedChinese
|
||||
})
|
||||
@@ -60,7 +59,7 @@
|
||||
|
||||
var Snackbar = 'undefined';
|
||||
if (theme.snackbar && theme.snackbar.enable) {
|
||||
Snackbar = JSON.stringify({
|
||||
Snackbar = JSON.stringify({
|
||||
bookmark: {
|
||||
message_prev: _p("Snackbar.bookmark.message_prev"),
|
||||
message_next: _p("Snackbar.bookmark.message_next")
|
||||
@@ -94,17 +93,18 @@ script.
|
||||
runtime: !{theme.runtimeshow.enable},
|
||||
copyright: !{copyright},
|
||||
ClickShowText: !{ClickShowText},
|
||||
medium_zoom: !{theme.medium_zoom.enable},
|
||||
fancybox: !{theme.fancybox.enable},
|
||||
medium_zoom: !{theme.medium_zoom},
|
||||
fancybox: !{theme.fancybox},
|
||||
Snackbar: !{Snackbar},
|
||||
baiduPush: !{theme.baidu_push && theme.baidu_push.enable},
|
||||
justifiedGallery: {
|
||||
js: '!{theme.CDN.justifiedGallery_js}',
|
||||
css: '!{theme.CDN.justifiedGallery_css}'
|
||||
},
|
||||
baiduPush: !{theme.baidu_push},
|
||||
highlightCopy: !{theme.highlight_copy},
|
||||
highlightLang: !{theme.highlight_lang},
|
||||
highlightShrink: '!{theme.highlight_shrink}',
|
||||
isFontAwesomeV5: !{theme.fontawesome_v5 && theme.fontawesome_v5.enable},
|
||||
isPhotoFigcaption: !{theme.photofigcaption},
|
||||
islazyload: !{theme.lazyload},
|
||||
isanchor: !{theme.anchor}
|
||||
|
||||
islazyload: !{theme.lazyload.enable},
|
||||
isanchor: !{theme.anchor}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
-
|
||||
let isHighlightShrink
|
||||
if (theme.highlight_shrink == 'none') isHighlightShrink = 'undefined'
|
||||
else if (page.highlight_shrink !== undefined) isHighlightShrink = page.highlight_shrink
|
||||
else isHighlightShrink = theme.highlight_shrink
|
||||
|
||||
const pageToc = page.toc !== undefined ? page.toc : theme.toc.enable
|
||||
const showToc = is_post() && pageToc && (toc(page.content) !== '' || page.encrypt == true )
|
||||
-
|
||||
|
||||
script.
|
||||
var GLOBAL_CONFIG_SITE = {
|
||||
isPost: !{is_post()},
|
||||
isHome: !{is_home()},
|
||||
isSidebar: !{is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )}
|
||||
isHighlightShrink: !{isHighlightShrink},
|
||||
isSidebar: !{showToc}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,47 +1,56 @@
|
||||
script.
|
||||
var activateDarkMode = function () {
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#000')
|
||||
}
|
||||
}
|
||||
var activateLightMode = function () {
|
||||
document.documentElement.setAttribute('data-theme', 'light')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#fff')
|
||||
}
|
||||
}
|
||||
|
||||
var getCookies = function (name) {
|
||||
const value = `; ${document.cookie}`
|
||||
const parts = value.split(`; ${name}=`)
|
||||
if (parts.length === 2) return parts.pop().split(';').shift()
|
||||
}
|
||||
|
||||
var autoChangeMode = '#{theme.darkmode.autoChangeMode}'
|
||||
var t = Cookies.get("theme")
|
||||
if (autoChangeMode == '1'){
|
||||
var isDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches
|
||||
var isLightMode = window.matchMedia("(prefers-color-scheme: light)").matches
|
||||
var isNotSpecified = window.matchMedia("(prefers-color-scheme: no-preference)").matches
|
||||
var t = getCookies('theme')
|
||||
if (autoChangeMode === '1') {
|
||||
var isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
var isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
|
||||
var isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
|
||||
var hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
|
||||
|
||||
if (t === undefined){
|
||||
if (t === undefined) {
|
||||
if (isLightMode) activateLightMode()
|
||||
else if (isDarkMode) activateDarkMode()
|
||||
else if (isNotSpecified || hasNoSupport){
|
||||
else if (isNotSpecified || hasNoSupport) {
|
||||
console.log('You specified no preference for a color scheme or your browser does not support it. I Schedule dark mode during night time.')
|
||||
var now = new Date()
|
||||
var hour = now.getHours()
|
||||
var isNight = hour < 6 || hour >= 18
|
||||
var isNight = hour <= 6 || hour >= 18
|
||||
isNight ? activateDarkMode() : activateLightMode()
|
||||
}
|
||||
} else if (t == 'light') activateLightMode()
|
||||
}
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
|
||||
if (Cookies.get('theme') === undefined) {
|
||||
e.matches ? activateDarkMode() : activateLightMode()
|
||||
}
|
||||
})
|
||||
} else if (t === 'light') activateLightMode()
|
||||
else activateDarkMode()
|
||||
|
||||
} else if (autoChangeMode == '2'){
|
||||
now = new Date();
|
||||
hour = now.getHours();
|
||||
isNight = hour < 6 || hour >= 18
|
||||
if(t === undefined) isNight? activateDarkMode() : activateLightMode()
|
||||
} else if (autoChangeMode === '2') {
|
||||
now = new Date()
|
||||
hour = now.getHours()
|
||||
isNight = hour <= 6 || hour >= 18
|
||||
if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
|
||||
else if (t === 'light') activateLightMode()
|
||||
else activateDarkMode()
|
||||
else activateDarkMode()
|
||||
} else {
|
||||
if ( t == 'dark' ) activateDarkMode()
|
||||
else if ( t == 'light') activateLightMode()
|
||||
if (t === 'dark') activateDarkMode()
|
||||
else if (t === 'light') activateLightMode()
|
||||
}
|
||||
|
||||
function activateDarkMode(){
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null){
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content','#000')
|
||||
}
|
||||
}
|
||||
function activateLightMode(){
|
||||
document.documentElement.setAttribute('data-theme', 'light')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null){
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content','#fff')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
link(rel="preconnect" href="//cdn.jsdelivr.net")
|
||||
link(rel="dns-prefetch" href="//cdn.jsdelivr.net")
|
||||
|
||||
if theme.google_analytics
|
||||
link(rel="preconnect" href="https://www.google-analytics.com" crossorigin)
|
||||
link(rel="dns-prefetch" href="https://www.google-analytics.com")
|
||||
|
||||
if theme.baidu_analytics
|
||||
link(rel="preconnect" href="https://hm.baidu.com")
|
||||
link(rel="dns-prefetch" href="https://hm.baidu.com")
|
||||
|
||||
if theme.tencent_analytics
|
||||
link(rel="preconnect" href="http://ta.qq.com")
|
||||
link(rel="dns-prefetch" href="http://ta.qq.com")
|
||||
|
||||
if theme.blog_title_font.font_link
|
||||
link(rel="preconnect" href="https://fonts.googleapis.com" crossorigin)
|
||||
link(rel="dns-prefetch" href="https://fonts.googleapis.com")
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
||||
link(rel="dns-prefetch" href="//busuanzi.ibruce.info")
|
||||
@@ -1,6 +1,6 @@
|
||||
noscript.
|
||||
<style>
|
||||
#page-header {
|
||||
#nav {
|
||||
opacity: 1
|
||||
}
|
||||
.justified-gallery img{
|
||||
|
||||
19
layout/includes/head/preconnect.pug
Normal file
19
layout/includes/head/preconnect.pug
Normal file
@@ -0,0 +1,19 @@
|
||||
link(rel="preconnect" href="//cdn.jsdelivr.net")
|
||||
|
||||
if theme.google_analytics
|
||||
link(rel="preconnect" href="//www.google-analytics.com" crossorigin)
|
||||
|
||||
if theme.baidu_analytics
|
||||
link(rel="preconnect" href="//hm.baidu.com")
|
||||
|
||||
if theme.tencent_analytics
|
||||
link(rel="preconnect" href="//ta.qq.com")
|
||||
|
||||
if theme.blog_title_font.font_link && theme.blog_title_font.font_link.indexOf('//fonts.googleapis.com') != -1
|
||||
link(rel="preconnect" href="//fonts.googleapis.com" crossorigin)
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
link(rel="preconnect" href="//busuanzi.ibruce.info")
|
||||
|
||||
if theme.baidu_push
|
||||
link(rel="preconnect" href="//zz.bdstatic.com")
|
||||
@@ -15,7 +15,7 @@ if theme.subtitle.enable
|
||||
})
|
||||
.then(function (data) {
|
||||
if (subtitleEffect) {
|
||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||
var both = sub.unshift(data.text)
|
||||
var typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
@@ -45,7 +45,7 @@ if theme.subtitle.enable
|
||||
.then(function (data) {
|
||||
if (subtitleEffect) {
|
||||
var from = '出自 ' + data.from
|
||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||
var both = sub.unshift(data.hitokoto, from)
|
||||
var typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
@@ -72,7 +72,7 @@ if theme.subtitle.enable
|
||||
var con = str[0]
|
||||
if (subtitleEffect) {
|
||||
var from = '出自 ' + str[1]
|
||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||
var both = sub.unshift(con, from)
|
||||
var typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
@@ -95,7 +95,7 @@ if theme.subtitle.enable
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
jinrishici.load(function (result) {
|
||||
if (subtitleEffect) {
|
||||
var sub = '!{theme.subtitle.sub}'.length == 0 ? new Array() : '!{theme.subtitle.sub}'.split(',')
|
||||
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||
var content = result.data.content
|
||||
var both = sub.unshift(content)
|
||||
var typed = new Typed('#subtitle', {
|
||||
@@ -119,7 +119,7 @@ if theme.subtitle.enable
|
||||
var subtitleEffect = !{subtitleEffect}
|
||||
if (subtitleEffect) {
|
||||
var typed = new Typed("#subtitle", {
|
||||
strings: '!{theme.subtitle.sub}'.split(","),
|
||||
strings: "!{theme.subtitle.sub}".split(","),
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
|
||||
@@ -24,8 +24,8 @@ if theme.douban
|
||||
- var isHomeClass = is_home() ? 'full_page' : 'not-index-bg'
|
||||
- is_post() ? isHomeClass = 'post-bg' : isHomeClass
|
||||
|
||||
#nav(class=isHomeClass style=bg_img)
|
||||
!=partial('includes/header/header', {}, {cache:theme.fragment_cache})
|
||||
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
|
||||
@@ -35,7 +35,7 @@ if theme.douban
|
||||
#site_social_icons
|
||||
!=fragment_cache('social', function(){return partial('includes/header/social')})
|
||||
#scroll_down
|
||||
i.fa.fa-angle-down.scroll-down-effects
|
||||
i.fas.fa-angle-down.scroll-down-effects
|
||||
else if is_post()
|
||||
include ./post-info.pug
|
||||
else
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
.menus_item
|
||||
a.site-page
|
||||
if label.split('||')[1]
|
||||
i.fa-fw(class=trim(label.split('||')[1]) aria-hidden="true")
|
||||
i.fa-fw(class=trim(label.split('||')[1]) )
|
||||
span=' '+ trim(label.split('||')[0])
|
||||
i.fa.fa-chevron-down.menus-expand(aria-hidden="true")
|
||||
i.fas.fa-chevron-down.menus-expand
|
||||
ul.menus_item_child
|
||||
each i in value
|
||||
li
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
#page-header
|
||||
span#blog_name.pull_left
|
||||
nav#nav
|
||||
span#blog_name.pull-left
|
||||
a#site-name.blog_title(href=url_for('/')) #[=config.title]
|
||||
|
||||
span.pull_right.menus
|
||||
span.pull-right.menus
|
||||
if (theme.algolia_search.enable || theme.local_search && theme.local_search.enable)
|
||||
#search_button
|
||||
a.site-page.social-icon.search
|
||||
i.fa.fa-search.fa-fw
|
||||
i.fas.fa-search.fa-fw
|
||||
span=' '+_p('search')
|
||||
!=fragment_cache('menus', function(){return partial('includes/header/menu_item')})
|
||||
|
||||
span.toggle-menu.close
|
||||
a.site-page
|
||||
i.fa.fa-bars.fa-fw(aria-hidden="true")
|
||||
i.fas.fa-bars.fa-fw
|
||||
|
||||
|
||||
@@ -8,19 +8,19 @@
|
||||
if (theme.post_meta.post.date_type === 'both')
|
||||
time.post-meta__date
|
||||
span.post-meta__date-created(title= _p('post.created')+' '+full_date(page.date))
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
i.far.fa-calendar-alt.fa-fw
|
||||
=' '+_p('post.created')+' '+date(page.date, config.date_format)
|
||||
span.post-meta__separator |
|
||||
span.post-meta__date-updated(title= _p('post.updated')+' '+full_date(page.updated))
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
i.fas.fa-history.fa-fw
|
||||
=' '+_p('post.updated')+' '+date(page.updated, config.date_format)
|
||||
else
|
||||
- var data_type_update = theme.post_meta.post.date_type === 'updated'
|
||||
- var date_type = data_type_update ? 'updated' : 'date'
|
||||
- var date_icon = data_type_update ? 'fa-history' :'fa-calendar'
|
||||
- var date_icon = data_type_update ? 'fas fa-history' :'far fa-calendar-alt'
|
||||
- var data_info = data_type_update ? _p('post.updated') : _p('post.created')
|
||||
time.post-meta__date(title=data_info + ' ' + full_date(page[date_type]))
|
||||
i.fa(class=date_icon aria-hidden="true")
|
||||
i.fa-fw(class=date_icon)
|
||||
=' ' + data_info + ' ' + date(page[date_type], config.date_format)
|
||||
|
||||
if (theme.post_meta.post.categories && page.categories.data.length > 0)
|
||||
@@ -29,25 +29,23 @@
|
||||
span.post-meta__separator |
|
||||
|
||||
each item, index in page.categories.data
|
||||
i.fa.fa-inbox.post-meta__icon(aria-hidden="true")
|
||||
i.fas.fa-inbox.fa-fw.post-meta__icon
|
||||
a(href=url_for(item.path)).post-meta__categories #[=item.name]
|
||||
if (index < page.categories.data.length - 1)
|
||||
i.fa.fa-angle-right.post-meta__separator(aria-hidden="true")
|
||||
i.fas.fa-angle-right.post-meta__separator
|
||||
|
||||
.meta-secondline
|
||||
- let postWordcount = theme.wordcount.enable && (theme.wordcount.post_wordcount || theme.wordcount.min2read)
|
||||
if (postWordcount)
|
||||
span.post-meta-wordcount
|
||||
if theme.wordcount.post_wordcount
|
||||
- var wordCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-file-word' : 'fa fa-file-word-o'
|
||||
i.post-meta__icon(class=wordCountIcon aria-hidden="true")
|
||||
i.far.fa-file-word.fa-fw.post-meta__icon
|
||||
span= _p('post.wordcount') + ':'
|
||||
span.word-count= wordcount(page.content)
|
||||
if theme.wordcount.min2read
|
||||
span.post-meta__separator |
|
||||
if theme.wordcount.min2read
|
||||
- var readCountIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-clock' : 'fa fa-clock-o'
|
||||
i.post-meta__icon(class=readCountIcon aria-hidden="true")
|
||||
i.far.fa-clock.fa-fw.post-meta__icon
|
||||
span= _p('post.min2read', min2read(page.content, {cn: 350, en: 160}))
|
||||
|
||||
.meta-thirdline
|
||||
@@ -55,37 +53,36 @@
|
||||
if (postWordcount && theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
if theme.busuanzi.page_pv
|
||||
i.fa.fa-eye.post-meta__icon(aria-hidden="true")
|
||||
i.far.fa-eye.fa-fw.post-meta__icon
|
||||
span=_p('post.page_pv') + ':'
|
||||
span#busuanzi_value_page_pv
|
||||
|
||||
span.post-meta-commentcount
|
||||
- var commentCount = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-comments' : 'fa fa-comment-o'
|
||||
if ((theme.disqus && theme.disqus.enable && theme.disqus.count && page.comments !== false) || (theme.disqusjs && theme.disqusjs.enable && theme.disqusjs.count && page.comments !== false))
|
||||
if (postWordcount || theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
i.far.fa-comments.fa-fw.post-meta__icon
|
||||
span= _p('post.comments') + ':'
|
||||
span.disqus-comment-count.comment-count
|
||||
a(href=full_url_for(page.path) + '#disqus_thread')
|
||||
else if (theme.valine && theme.valine.enable && theme.valine.count && page.comments !== false)
|
||||
if (postWordcount || theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
i.far.fa-comments.fa-fw.post-meta__icon
|
||||
span= _p('post.comments') + ':'
|
||||
a(href=url_for(page.path) + '#post-comment' itemprop="discussionUrl")
|
||||
span.valine-comment-count.comment-count(data-xid=url_for(page.path) itemprop="commentCount")
|
||||
else if (theme.gitalk && theme.gitalk.enable && theme.gitalk.count && page.comments !== false)
|
||||
if (postWordcount || theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
i.far.fa-comments.fa-fw.post-meta__icon
|
||||
span= _p('post.comments') + ':'
|
||||
a(href=url_for(page.path) + '#post-comment')
|
||||
span.gitalk-comment-count.comment-count
|
||||
else if theme.facebook_comments.enable && theme.facebook_comments.count && page.comments !== false
|
||||
if (postWordcount || theme.busuanzi.page_pv)
|
||||
span.post-meta__separator |
|
||||
i.post-meta__icon(class=commentCount aria-hidden="true")
|
||||
i.far.fa-comments.fa-fw.post-meta__icon
|
||||
span= _p('post.comments') + ':'
|
||||
a.comment-count(href=url_for(page.path) + '#post-comment')
|
||||
span.fb-comments-count(data-href=urlNoIndex())
|
||||
@@ -1,4 +1,4 @@
|
||||
each url, icon in theme.social
|
||||
a.social-icon(href=trim(url.split('||')[0]) target="_blank"
|
||||
a.social-icon(href=url_for(trim(url.split('||')[0])) target="_blank"
|
||||
title=url.split('||')[1] === undefined ? '' : trim(url.split('||')[1]))
|
||||
i(class=icon aria-hidden="true")
|
||||
i(class=icon)
|
||||
@@ -1,4 +1,6 @@
|
||||
- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''
|
||||
- var pageHighlightShrinkSet = page.highlight_shrink !== undefined ? page.highlight_shrink : theme.highlight_shrink
|
||||
- var pageHighlightShrink = theme.highlight_shrink !== 'none' && pageHighlightShrinkSet ? 'code-close' : ''
|
||||
|
||||
doctype html
|
||||
html(lang=config.language data-theme=theme.display_mode)
|
||||
@@ -15,10 +17,11 @@ html(lang=config.language data-theme=theme.display_mode)
|
||||
|
||||
include ./sidebar.pug
|
||||
|
||||
#body-wrap
|
||||
#body-wrap(class=pageHighlightShrink)
|
||||
if theme.background
|
||||
- var is_photo = theme.background.substring(3,0) === 'url' ? 'photo':'color'
|
||||
- var is_photo = theme.background.startsWith('url') ? 'photo':'color'
|
||||
#web_bg(data-type=is_photo)
|
||||
|
||||
include ./header/index.pug
|
||||
|
||||
if (!is_post())
|
||||
|
||||
@@ -11,10 +11,10 @@ mixin articleSort(posts)
|
||||
if article.cover && theme.cover.archives_enable
|
||||
.article-sort-img
|
||||
a.article-sort-item__img(href=url_for(article.path))
|
||||
img(src=url_for(article.cover) alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'`)
|
||||
img(src=url_for(article.cover) alt=article.title || 'No Title' onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'`)
|
||||
.article-sort-post
|
||||
a.article-sort-item__post(href=url_for(article.path))
|
||||
i.fa.fa-clock-o(aria-hidden="true")
|
||||
i.far.fa-calendar-alt
|
||||
time.article-sort-item__time(title=_p('post.created') + ' ' + full_date(article.date))= date(article.date, config.date_format)
|
||||
.article-sort-item__title= article.title || 'No Title'
|
||||
- })
|
||||
@@ -9,59 +9,69 @@ mixin postUI(posts)
|
||||
if post_cover && theme.cover.index_enable
|
||||
.post_cover(class=leftOrRight)
|
||||
a(href=url_for(link) title=title)
|
||||
if theme.lazyload
|
||||
img.post_bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
||||
if theme.lazyload.enable
|
||||
img.post_bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title)
|
||||
else
|
||||
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` alt=title)
|
||||
img.post_bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` alt=title)
|
||||
.recent-post-info(class=no_cover)
|
||||
a.article-title(href=url_for(link) title=title)= title
|
||||
.article-meta-wrap
|
||||
if (is_home() && (article.top || article.sticky > 0))
|
||||
span.article-meta
|
||||
i.fa.fa-thumb-tack.article-meta__icon.sticky
|
||||
i.fas.fa-thumbtack.article-meta__icon.sticky
|
||||
span.sticky= _p('sticky')
|
||||
span.article-meta__separator |
|
||||
if (theme.post_meta.page.date_type)
|
||||
if (theme.post_meta.page.date_type === 'both')
|
||||
time.post-meta__date
|
||||
span.post-meta__date-created(title=_p('post.created') + ' ' + full_date(article.date))
|
||||
i.fa.fa-calendar(aria-hidden="true")
|
||||
i.far.fa-calendar-alt
|
||||
=date(article.date, config.date_format)
|
||||
span.article-meta__separator |
|
||||
span.post-meta__date-updated(title=_p('post.updated') + ' ' + full_date(article.updated))
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
i.fas.fa-history
|
||||
=date(article.updated, config.date_format)
|
||||
else
|
||||
- var data_type_updated = theme.post_meta.page.date_type === 'updated'
|
||||
- var date_type = data_type_updated ? 'updated' : 'date'
|
||||
- var date_icon = data_type_updated ? 'fa-history' :'fa-calendar'
|
||||
- var date_icon = data_type_updated ? 'fas fa-history' :'far fa-calendar-alt'
|
||||
- var date_title = data_type_updated ? _p('post.updated') : _p('post.created')
|
||||
time.post-meta__date(title=date_title + ' ' + full_date(article[date_type]))
|
||||
i.fa(class=date_icon aria-hidden="true")
|
||||
i(class=date_icon)
|
||||
=date(article[date_type], config.date_format)
|
||||
if (theme.post_meta.page.categories && article.categories.data.length > 0)
|
||||
span.article-meta
|
||||
span.article-meta__separator |
|
||||
i.fas.fa-inbox.article-meta__icon
|
||||
each item, index in article.categories.data
|
||||
i.fa.fa-inbox.article-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).article-meta__categories #[=item.name]
|
||||
if (index < article.categories.data.length - 1)
|
||||
i.fa.fa-angle-right(aria-hidden="true")
|
||||
i.fas.fa-angle-right
|
||||
if (theme.post_meta.page.tags && article.tags.data.length > 0)
|
||||
span.article-meta.tags
|
||||
span.article-meta__separator |
|
||||
i.fas.fa-tag.article-meta__icon
|
||||
each item, index in article.tags.data
|
||||
i.fa.fa-tag.article-meta__icon(aria-hidden="true")
|
||||
a(href=url_for(item.path)).article-meta__tags #[=item.name]
|
||||
if (index < article.tags.data.length - 1)
|
||||
span.article-meta__link -
|
||||
if theme.auto_excerpt && theme.auto_excerpt.enable
|
||||
- const content = strip_html(article.content)
|
||||
- let expert = content.substring(0, theme.auto_excerpt.length)
|
||||
- content.length > theme.auto_excerpt.length ? expert += ' ...' : ''
|
||||
.content!= expert
|
||||
else
|
||||
span.article-meta__link #[='•']
|
||||
|
||||
//- Display the article introduction on homepage
|
||||
if theme.index_post_content.method == 1
|
||||
.content!= article.description
|
||||
else if theme.index_post_content.method == 2
|
||||
if article.description
|
||||
.content!= article.description
|
||||
else
|
||||
- const content = strip_html(article.content)
|
||||
- let expert = content.substring(0, theme.index_post_content.length)
|
||||
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
|
||||
.content!= expert
|
||||
else
|
||||
- const content = strip_html(article.content)
|
||||
- let expert = content.substring(0, theme.index_post_content.length)
|
||||
- content.length > theme.index_post_content.length ? expert += ' ...' : ''
|
||||
.content!= expert
|
||||
|
||||
if theme.ad && theme.ad.index
|
||||
if (index + 1) % 3 == 0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#mobile-sidebar-menus
|
||||
.mobile_author_icon
|
||||
img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.lodding_bg.flink}'` alt="avatar")
|
||||
img.avatar-img(src=url_for(theme.avatar.img) onerror=`onerror=null;src='${theme.error_img.flink}'` alt="avatar")
|
||||
.mobile_post_data
|
||||
if site.posts.length
|
||||
.mobile_data_item.is-center
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
-
|
||||
var options = {
|
||||
prev_text: '<i class="fa fa-fw fa-chevron-left" aria-hidden="true"></i>',
|
||||
next_text: '<i class="fa fa-fw fa-chevron-right" aria-hidden="true"></i>',
|
||||
prev_text: '<i class="fas fa-chevron-left fa-fw"></i>',
|
||||
next_text: '<i class="fas fa-chevron-right fa-fw"></i>',
|
||||
mid_size: 1,
|
||||
escape: false
|
||||
}
|
||||
@@ -11,29 +11,29 @@ if(!is_post())
|
||||
div.pagination
|
||||
!=paginator(options)
|
||||
else
|
||||
nav#pagination.pagination_post
|
||||
nav#pagination.pagination-post
|
||||
if(page.prev)
|
||||
- var hasPageNext = page.prev ? 'pull_left' : 'pull-full'
|
||||
- var hasPageNext = page.next ? 'pull-left' : 'pull-full'
|
||||
.prev-post(class=hasPageNext)
|
||||
- var pagination_cover = page.prev.cover === false ? page.prev.randomcover : page.prev.cover
|
||||
a(href=url_for(page.prev.path))
|
||||
if theme.lazyload
|
||||
img.prev_cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'` )
|
||||
if theme.lazyload.enable
|
||||
img.prev-cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` )
|
||||
else
|
||||
img.prev_cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'` )
|
||||
img.prev-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'` )
|
||||
.pagination-info
|
||||
.label=_p('pagination.prev')
|
||||
.prev_info=page.prev.title
|
||||
|
||||
if(page.next)
|
||||
- var hasPagePrev = page.prev ? 'pull_right' : 'pull-full'
|
||||
- var hasPagePrev = page.prev ? 'pull-right' : 'pull-full'
|
||||
- var pagination_cover = page.next.cover == false ? page.next.randomcover : page.next.cover
|
||||
.next-post(class=hasPagePrev)
|
||||
a(href=url_for(page.next.path))
|
||||
if theme.lazyload
|
||||
img.next_cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'`)
|
||||
if theme.lazyload.enable
|
||||
img.next-cover(data-src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`)
|
||||
else
|
||||
img.next_cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.lodding_bg.post_page)}'`)
|
||||
img.next-cover(src=url_for(pagination_cover) onerror=`onerror=null;src='${url_for(theme.error_img.post_page)}'`)
|
||||
.pagination-info
|
||||
.label=_p('pagination.next')
|
||||
.next_info=page.next.title
|
||||
@@ -1,11 +1,12 @@
|
||||
.post-reward
|
||||
a.reward-button.button--primary.button--animated
|
||||
i.fa.fa-qrcode
|
||||
button.reward-button
|
||||
i.fas.fa-qrcode
|
||||
= ' ' + _p('donate')
|
||||
.reward-main
|
||||
ul.reward-all
|
||||
each item in theme.reward.QR_code
|
||||
- var clickTo = (item.itemlist||item).link ? (item.itemlist||item).link : (item.itemlist||item).img
|
||||
li.reward-item
|
||||
img.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text)
|
||||
img.post-qr-code__img(src=url_for((item.itemlist||item).img) alt=(item.itemlist||item).text onclick=`window.open('${url_for(clickTo)}')`)
|
||||
.post-qr-code__desc=(item.itemlist||item).text
|
||||
|
||||
|
||||
@@ -1,23 +1,32 @@
|
||||
section#rightside.rightside
|
||||
#rightside-config-hide
|
||||
if theme.readmode.enable && is_post()
|
||||
i#readmode.fa.fa-book(title=_p('rightside.readmode_title'))
|
||||
if is_post()
|
||||
i#font_plus.fa.fa-plus(title=_p('rightside.font_plus_title'))
|
||||
i#font_minus.fa.fa-minus(title=_p('rightside.font_minus_title'))
|
||||
if theme.readmode
|
||||
button#readmode(title=_p('rightside.readmode_title'))
|
||||
i.fas.fa-book-open
|
||||
button#font_plus(title=_p('rightside.font_plus_title'))
|
||||
i.fas.fa-plus
|
||||
button#font_minus(title=_p('rightside.font_minus_title'))
|
||||
i.fas.fa-minus
|
||||
if theme.translate && theme.translate.enable
|
||||
a#translateLink.translate_chn_to_cht(href="javascript:translatePage();" title=_p('rightside.translate_title') target="_self")= theme.translate.default
|
||||
button#translateLink.translate_chn_to_cht(title=_p('rightside.translate_title'))= theme.translate.default
|
||||
if theme.darkmode.enable && theme.darkmode.button
|
||||
- var lightModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-sun' : 'fa fa-sun-o'
|
||||
- var darkModeIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'far fa-moon' : 'fa fa-moon-o'
|
||||
- var display_mode = theme.display_mode == 'dark' ? lightModeIcon : darkModeIcon
|
||||
i#darkmode.darkmode(class=display_mode title=_p('rightside.night_mode_title'))
|
||||
button#darkmode(title=_p('rightside.night_mode_title'))
|
||||
i.fas.fa-adjust
|
||||
#rightside-config-show
|
||||
#rightside_config(title=_p("rightside.setting"))
|
||||
i.fa.fa-cog(aria-hidden="true")
|
||||
button#rightside_config(title=_p("rightside.setting"))
|
||||
i.fas.fa-cog
|
||||
if is_post() && page.comments !== false && isComment
|
||||
a#to_comment(href="#post-comment" title=_p("rightside.scroll_to_comment"))
|
||||
i.scroll_to_comment.fa.fa-comments
|
||||
if is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )
|
||||
i#mobile-toc-button.fa.fa-list-ul.close(title=_p("rightside.toc") aria-hidden="true")
|
||||
i.fa.fa-arrow-up#go-up(title=_p("rightside.back_to_top") aria-hidden="true")
|
||||
i.scroll_to_comment.fas.fa-comments
|
||||
if showToc
|
||||
button#mobile-toc-button.close(title=_p("rightside.toc"))
|
||||
i.fas.fa-list-ul
|
||||
if theme.chat_btn && (theme.chatra.enable || theme.tidio.enable || theme.daovoice.enable || theme.gitter.enable)
|
||||
button#chat_btn(title=_p("rightside.chat_btn"))
|
||||
i.fas.fa-sms
|
||||
|
||||
button#go-up(title=_p("rightside.back_to_top"))
|
||||
i.fas.fa-arrow-up
|
||||
|
||||
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
#algolia-pagination
|
||||
#algolia-stats
|
||||
span.search-close-button
|
||||
i.fa.fa-times
|
||||
i.fas.fa-times
|
||||
.search-mask
|
||||
|
||||
@@ -19,5 +19,5 @@
|
||||
span=_p("local_search.powered_by")
|
||||
| #[a(href="https://github.com/wzpan/hexo-generator-search" style={'color': '#49B1F5'}) hexo-generator-search]
|
||||
span.search-close-button
|
||||
i.fa.fa-times
|
||||
i.fas.fa-times
|
||||
.search-mask
|
||||
@@ -1,15 +1,11 @@
|
||||
- let showToc = is_post() && page.toc !== false && theme.toc.enable && (toc(page.content) !== '' || page.encrypt == true )
|
||||
- let autoOpenSidebar = theme.auto_open_sidebar.enable === true ? 'on' : ''
|
||||
|
||||
-
|
||||
let tocNumber
|
||||
if (page.toc_number !== undefined) tocNumber = page.toc_number
|
||||
else if (theme.toc.number !== undefined) tocNumber = theme.toc.number
|
||||
else tocNumber = true
|
||||
let tocNumber = page.toc_number !== undefined ? page.toc_number : theme.toc.number
|
||||
let autoOpenPostSet = page.auto_open == undefined ? theme.toc.auto_open : page.auto_open
|
||||
let autoOpenSidebar = autoOpenPostSet ? 'on' : ''
|
||||
-
|
||||
|
||||
if(showToc)
|
||||
i.fa.fa-arrow-right#toggle-sidebar(aria-hidden="true" class=autoOpenSidebar)
|
||||
i.fas.fa-arrow-right#toggle-sidebar(class=autoOpenSidebar)
|
||||
#sidebar
|
||||
.sidebar-toc
|
||||
div.sidebar-toc__title= _p('sidebar.catalog')
|
||||
|
||||
15
layout/includes/third-party/pangu.pug
vendored
15
layout/includes/third-party/pangu.pug
vendored
@@ -1,13 +1,12 @@
|
||||
script(src=url_for(theme.CDN.pangu))
|
||||
if theme.pangu.field === 'post'
|
||||
if is_post()
|
||||
script.
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
pangu.spacingElementById('content-inner')
|
||||
})
|
||||
else if theme.pangu.field === 'page'
|
||||
if theme.pangu.field === 'post' && is_post()
|
||||
script.
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
pangu.spacingElementById('content-inner')
|
||||
pangu.autoSpacingPage()
|
||||
})
|
||||
else if theme.pangu.field === 'site'
|
||||
script.
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
pangu.autoSpacingPage()
|
||||
})
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.card-widget.card-announcement
|
||||
.card-content
|
||||
.item-headline
|
||||
i.fa.fa-bullhorn.card-announcement-animation(aria-hidden="true")
|
||||
i.fas.fa-bullhorn.card-announcement-animation
|
||||
span= _p('aside.card_announcement')
|
||||
.announcement_content!= theme.aside.card_announcement.content
|
||||
@@ -1,7 +1,7 @@
|
||||
.card-widget.card-archives
|
||||
.card-content
|
||||
.item-headline
|
||||
i.fa.fa-archive(aria-hidden="true")
|
||||
i.fas.fa-archive
|
||||
span= _p('aside.card_archives')
|
||||
|
||||
- let type = theme.aside.card_archives.type || 'monthly'
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.card-widget.card-info
|
||||
.card-content
|
||||
.card-info-avatar.is-center
|
||||
img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.lodding_bg.flink) + `'` alt="avatar")
|
||||
img.avatar-img(src=url_for(theme.avatar.img) onerror=`this.onerror=null;this.src='` + url_for(theme.error_img.flink) + `'` alt="avatar")
|
||||
.author-info__name= config.author
|
||||
.author-info__description= theme.aside.card_author.description || config.description
|
||||
.author-info__description!= theme.aside.card_author.description || config.description
|
||||
|
||||
.card-info-data
|
||||
if site.posts.length
|
||||
@@ -25,8 +25,8 @@
|
||||
.length_num= site.categories.length
|
||||
|
||||
.card-info-bookmark.is-center
|
||||
a#bookmark-it.bookmark.button--primary.button--animated(href="javascript:;" title= _p('aside.card_bookmark') target="_self")
|
||||
i.fa.fa-bookmark(aria-hidden="true")
|
||||
button#bookmark-it.button--animated(title= _p('aside.card_bookmark'))
|
||||
i.fas.fa-bookmark
|
||||
span= _p('aside.card_bookmark') || 'Follow Me'
|
||||
|
||||
if(theme.social)
|
||||
|
||||
@@ -2,8 +2,8 @@ if site.categories.length
|
||||
.card-widget.card-categories
|
||||
.card-content
|
||||
.item-headline
|
||||
i.fa.fa-folder-open(aria-hidden="true")
|
||||
i.fas.fa-folder-open
|
||||
span= _p('aside.card_categories')
|
||||
!=aside_categories({ limit: theme.aside.card_categories.limit === 0 ? 0 : theme.aside.card_categories.limit || 8 })
|
||||
!=aside_categories({ limit: theme.aside.card_categories.limit === 0 ? 0 : theme.aside.card_categories.limit || 8 , expand: theme.aside.card_categories.expand })
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.card-widget.card-recent-post
|
||||
.card-content
|
||||
.item-headline
|
||||
i.fa.fa-history(aria-hidden="true")
|
||||
i.fas.fa-history
|
||||
span= _p('aside.card_recent_post')
|
||||
.aside-recent-item
|
||||
- var postLimit = theme.aside.card_recent_post.limit === 0 ? site.posts.length : theme.aside.card_recent_post.limit || 5
|
||||
@@ -15,10 +15,10 @@
|
||||
a(href=url_for(link))
|
||||
if post_cover && theme.cover.aside_enable
|
||||
.aside-post-cover
|
||||
if theme.lazyload
|
||||
img.aside-post-bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
||||
if theme.lazyload.enable
|
||||
img.aside-post-bg(data-src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` title=title alt=title)
|
||||
else
|
||||
img.aside-post-bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.lodding_bg.post_page) + `'` title=title alt=title)
|
||||
img.aside-post-bg(src=url_for(post_cover) onerror=`this.onerror=null;this.src='`+ url_for(theme.error_img.post_page) + `'` title=title alt=title)
|
||||
.aside-post-title(class=no_cover)
|
||||
.aside-post_title(href=url_for(link) title=article.title || _p('no_title'))= article.title || _p('no_title')
|
||||
time.aside-post_meta.post-meta__date(title=_p('post.created') + ' ' + full_date(article.date)) #[=date(article.date, config.date_format)]
|
||||
|
||||
@@ -2,7 +2,7 @@ if site.tags.length
|
||||
.card-widget.card-tags
|
||||
.card-content
|
||||
.item-headline
|
||||
i.fa.fa-tags(aria-hidden="true")
|
||||
i.fas.fa-tags
|
||||
span= _p('aside.card_tags')
|
||||
|
||||
- let tagLimit = theme.aside.card_tags.limit === 0 ? 0 : theme.aside.card_tags.limit || 40
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
- var webinfoIcon = theme.fontawesome_v5 && theme.fontawesome_v5.enable ? 'fas fa-chart-line' : 'fa fa-line-chart'
|
||||
.card-widget.card-webinfo
|
||||
.card-content
|
||||
.item-headline
|
||||
i(class=webinfoIcon aria-hidden="true")
|
||||
i.fas.fa-chart-line
|
||||
span= _p('aside.card_webinfo.headline')
|
||||
.webinfo
|
||||
.webinfo-item
|
||||
@@ -11,7 +10,7 @@
|
||||
if theme.runtimeshow.enable
|
||||
.webinfo-item
|
||||
.webinfo-runtime-name= _p('aside.card_webinfo.runtime_name') + " :"
|
||||
#webinfo-runtime-count.webinfo-runtime-count(start_date=theme.runtimeshow.start_date)
|
||||
#webinfo-runtime-count.webinfo-runtime-count(publish_date=theme.runtimeshow.publish_date)
|
||||
if theme.wordcount.enable && theme.wordcount.total_wordcount
|
||||
.webinfo-item
|
||||
.webinfo-site-wordcount-name=_p('aside.card_webinfo.site_wordcount') + " :"
|
||||
|
||||
Reference in New Issue
Block a user