pjax
parent
5b6e008b84
commit
898cc31c58
@ -1,76 +1,90 @@
|
||||
script(src=url_for(theme.CDN.jquery))
|
||||
script(src=url_for(theme.CDN.utils))
|
||||
script(src=url_for(theme.CDN.main))
|
||||
div
|
||||
script(src=url_for(theme.CDN.jquery))
|
||||
script(src=url_for(theme.CDN.utils))
|
||||
script(src=url_for(theme.CDN.main))
|
||||
|
||||
if theme.translate && theme.translate.enable
|
||||
script(src=url_for(theme.CDN.translate))
|
||||
if theme.translate && theme.translate.enable
|
||||
script(src=url_for(theme.CDN.translate))
|
||||
|
||||
if theme.medium_zoom
|
||||
script(src=url_for(theme.CDN.medium_zoom))
|
||||
if theme.medium_zoom
|
||||
script(src=url_for(theme.CDN.medium_zoom))
|
||||
|
||||
if theme.fancybox
|
||||
script(src=url_for(theme.CDN.fancybox))
|
||||
if theme.fancybox
|
||||
script(src=url_for(theme.CDN.fancybox))
|
||||
|
||||
include ./math/index.pug
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
script(src=url_for(theme.CDN.anime))
|
||||
script(src=url_for(theme.CDN.fireworks))
|
||||
|
||||
if theme.fireworks && theme.fireworks.enable
|
||||
script(src=url_for(theme.CDN.anime))
|
||||
script(src=url_for(theme.CDN.fireworks))
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
script(src=url_for(theme.CDN.snackbar))
|
||||
|
||||
if (theme.snackbar && theme.snackbar.enable)
|
||||
script(src=url_for(theme.CDN.snackbar))
|
||||
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||
include ./third-party/canvas-ribbon.pug
|
||||
|
||||
if (theme.canvas_ribbon && theme.canvas_ribbon.enable)
|
||||
include ./third-party/canvas-ribbon.pug
|
||||
if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
|
||||
include ./third-party/canvas-ribbon-piao.pug
|
||||
|
||||
if (theme.canvas_ribbon_piao && theme.canvas_ribbon_piao.enable)
|
||||
include ./third-party/canvas-ribbon-piao.pug
|
||||
if (theme.canvas_nest && theme.canvas_nest.enable)
|
||||
include ./third-party/canvas-nest.pug
|
||||
|
||||
if (theme.canvas_nest && theme.canvas_nest.enable)
|
||||
include ./third-party/canvas-nest.pug
|
||||
if theme.activate_power_mode.enable
|
||||
script(src=url_for(theme.CDN.activate_power_mode))
|
||||
script.
|
||||
POWERMODE.colorful = #{theme.activate_power_mode.colorful};
|
||||
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
||||
document.body.addEventListener('input', POWERMODE);
|
||||
|
||||
if theme.activate_power_mode.enable
|
||||
script(src=url_for(theme.CDN.activate_power_mode))
|
||||
script.
|
||||
POWERMODE.colorful = #{theme.activate_power_mode.colorful};
|
||||
POWERMODE.shake = #{theme.activate_power_mode.shake};
|
||||
document.body.addEventListener('input', POWERMODE);
|
||||
if theme.instantpage
|
||||
script(src=url_for(theme.CDN.instantpage) type="module" defer)
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async src=url_for(theme.CDN.busuanzi))
|
||||
if theme.lazyload.enable
|
||||
script(src=url_for(theme.CDN.lazyload) async)
|
||||
|
||||
if theme.instantpage
|
||||
script(src=url_for(theme.CDN.instantpage) type="module" defer)
|
||||
//- 鼠標特效
|
||||
if theme.click_heart
|
||||
script(src=url_for(theme.CDN.click_heart))
|
||||
|
||||
if theme.lazyload.enable
|
||||
script(src=url_for(theme.CDN.lazyload) async)
|
||||
if theme.ClickShowText && theme.ClickShowText.enable
|
||||
script(src=url_for(theme.CDN.ClickShowText))
|
||||
|
||||
//- 鼠標特效
|
||||
if theme.click_heart
|
||||
script(src=url_for(theme.CDN.click_heart))
|
||||
if theme.pangu && theme.pangu.enable
|
||||
include ./third-party/pangu.pug
|
||||
|
||||
if theme.ClickShowText && theme.ClickShowText.enable
|
||||
script(src=url_for(theme.CDN.ClickShowText))
|
||||
//- search
|
||||
if theme.algolia_search && theme.algolia_search.enable
|
||||
script(src=url_for(theme.CDN.algolia_js))
|
||||
else if theme.local_search && theme.local_search.enable
|
||||
script(src=url_for(theme.CDN.local_search))
|
||||
|
||||
if theme.pangu && theme.pangu.enable
|
||||
include ./third-party/pangu.pug
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading-js', {}, {cache:theme.fragment_cache})
|
||||
|
||||
//- search
|
||||
if theme.algolia_search && theme.algolia_search.enable
|
||||
script(src=url_for(theme.CDN.algolia_js))
|
||||
else if theme.local_search && theme.local_search.enable
|
||||
script(src=url_for(theme.CDN.local_search))
|
||||
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache})
|
||||
|
||||
//- mermaid
|
||||
if theme.mermaid.enable
|
||||
include ./math/mermaid.pug
|
||||
.js-pjax
|
||||
if is_home() && theme.subtitle.enable
|
||||
include ./third-party/subtitle.pug
|
||||
|
||||
if is_home()
|
||||
include ./head/subtitle.pug
|
||||
include ./math/index.pug
|
||||
|
||||
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||
//- mermaid
|
||||
if theme.mermaid.enable
|
||||
include ./third-party/mermaid.pug
|
||||
|
||||
if theme.preloader
|
||||
!=partial('includes/loading/loading-js', {}, {cache:theme.fragment_cache})
|
||||
if commentsJsLoad
|
||||
include ./comments/js.pug
|
||||
|
||||
!=partial('includes/chat/index', {}, {cache:theme.fragment_cache})
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async src=url_for(theme.CDN.busuanzi))
|
||||
|
||||
if theme.aplayerInject
|
||||
if theme.pjax
|
||||
include ./head/aplayer.pug
|
||||
else if page.aplayer
|
||||
include ./head/aplayer.pug
|
||||
|
||||
if theme.pjax
|
||||
include ./third-party/pjax.pug
|
||||
|
||||
!=fragment_cache('injectBottom', function(){return injectHtml(theme.inject.bottom)})
|
||||
|
@ -1,28 +1,25 @@
|
||||
//- https://sidecar.gitter.im/
|
||||
script.
|
||||
var isChatBtn = !{theme.chat_btn}
|
||||
|
||||
if (isChatBtn) {
|
||||
if theme.chat_btn
|
||||
script.
|
||||
((window.gitter = {}).chat = {}).options = {
|
||||
room: '#{theme.gitter.room}',
|
||||
activationElement: '#chat_btn'
|
||||
};
|
||||
} else {
|
||||
|
||||
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)
|
||||
|
||||
else
|
||||
script.
|
||||
((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'
|
||||
document.getElementsByClassName('gitter-open-chat-button')[0].style.display= 'none'
|
||||
}
|
||||
|
||||
function chatBtnShow () {
|
||||
gitterBtn[0].style.display= 'block'
|
||||
document.getElementsByClassName('gitter-open-chat-button')[0].style.display= 'block'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)
|
||||
script(src="https://sidecar.gitter.im/dist/sidecar.v1.js" async defer)
|
||||
|
@ -1,36 +1,38 @@
|
||||
if theme.comments && theme.comments.use
|
||||
- const defaultComment = theme.comments.use[0]
|
||||
hr
|
||||
#post-comment
|
||||
.comment-head
|
||||
.comment-headling
|
||||
i.fas.fa-comments.fa-fw
|
||||
span= ' ' + _p('comment')
|
||||
|
||||
if theme.comments.use.length > 1
|
||||
.comment-switch
|
||||
span.first-comment=defaultComment
|
||||
label
|
||||
input#switch-comments-btn(type="checkbox")
|
||||
span.slider
|
||||
span.second-comment=theme.comments.use[1]
|
||||
- let defaultComment = theme.comments.use[0]
|
||||
hr
|
||||
#post-comment
|
||||
.comment-head
|
||||
.comment-headling
|
||||
i.fas.fa-comments.fa-fw
|
||||
span= ' ' + _p('comment')
|
||||
|
||||
if theme.comments.use.length > 1
|
||||
.comment-switch
|
||||
span.first-comment=defaultComment
|
||||
label
|
||||
input#switch-comments-btn(type="checkbox")
|
||||
span.slider
|
||||
span.second-comment=theme.comments.use[1]
|
||||
|
||||
|
||||
.comment-wrap
|
||||
each name, index in theme.comments.use
|
||||
div(class=`comments-items-${index+1}` data-name=`${name}`)
|
||||
case name
|
||||
when 'Disqus'
|
||||
include ./disqus.pug
|
||||
when 'Valine'
|
||||
include ./valine.pug
|
||||
when 'Disqusjs'
|
||||
include ./disqusjs.pug
|
||||
when 'Livere'
|
||||
include ./livere.pug
|
||||
when 'Gitalk'
|
||||
include ./gitalk.pug
|
||||
when 'Utterances'
|
||||
include ./utterances.pug
|
||||
when 'Facebook Comments'
|
||||
include ./facebook_comments.pug
|
||||
.comment-wrap
|
||||
each name in theme.comments.use
|
||||
div
|
||||
case name
|
||||
when 'Disqus'
|
||||
#disqus_thread
|
||||
when 'Valine'
|
||||
#vcomment.vcomment
|
||||
when 'Disqusjs'
|
||||
#disqus_thread
|
||||
when 'Livere'
|
||||
#lv-container(data-id="city" data-uid=theme.livere.uid)
|
||||
when 'Gitalk'
|
||||
#gitalk-container
|
||||
when 'Utterances'
|
||||
#utterances-wrap
|
||||
when 'Facebook Comments'
|
||||
.fb-comments(data-colorscheme = theme.display_mode === 'dark' ? 'dark' : 'light'
|
||||
data-numposts= theme.facebook_comments.pageSize || 10
|
||||
data-order-by= theme.facebook_comments.order_by || 'social'
|
||||
data-width="100%")
|
||||
|
@ -0,0 +1,17 @@
|
||||
- let defaultComment = theme.comments.use[0]
|
||||
each name in theme.comments.use
|
||||
case name
|
||||
when 'Disqus'
|
||||
include ./disqus.pug
|
||||
when 'Valine'
|
||||
include ./valine.pug
|
||||
when 'Disqusjs'
|
||||
include ./disqusjs.pug
|
||||
when 'Livere'
|
||||
include ./livere.pug
|
||||
when 'Gitalk'
|
||||
include ./gitalk.pug
|
||||
when 'Utterances'
|
||||
include ./utterances.pug
|
||||
when 'Facebook Comments'
|
||||
include ./facebook_comments.pug
|
@ -1,21 +1,23 @@
|
||||
#lv-container(data-id="city" data-uid=theme.livere.uid)
|
||||
script.
|
||||
function loadlivere () {
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
if (typeof LivereTower === 'function') { return; }
|
||||
j = d.createElement(s);
|
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||
j.async = true;
|
||||
e.parentNode.insertBefore(j, e);
|
||||
})(document, 'script');
|
||||
}
|
||||
script.
|
||||
function loadlivere () {
|
||||
(function(d, s) {
|
||||
var j, e = d.getElementsByTagName(s)[0];
|
||||
if (typeof LivereTower === 'function') { return; }
|
||||
j = d.createElement(s);
|
||||
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
|
||||
j.async = true;
|
||||
e.parentNode.insertBefore(j, e);
|
||||
})(document, 'script');
|
||||
}
|
||||
|
||||
if ('!{defaultComment}' === 'Livere' || !{theme.comments.load_begin}) {
|
||||
window.addEventListener('load', loadlivere)
|
||||
if ('!{defaultComment}' === 'Livere' || !{theme.comments.load_begin}) {
|
||||
loadlivere()
|
||||
}
|
||||
else {
|
||||
function loadOtherComment () {
|
||||
loadlivere()
|
||||
}
|
||||
else {
|
||||
function loadOtherComment () {
|
||||
loadlivere()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
noscript.
|
||||
Please activate JavaScript for write a comment in LiveRe
|
@ -1,36 +1,36 @@
|
||||
#utterances-wrap
|
||||
|
||||
script.
|
||||
function loadUtterances () {
|
||||
let ele = document.createElement('script')
|
||||
ele.setAttribute('id', 'utterances_comment')
|
||||
ele.setAttribute('src', '!{url_for(theme.CDN.utterances)}')
|
||||
ele.setAttribute('repo', '!{theme.utterances.repo}')
|
||||
ele.setAttribute('issue-term', '!{theme.utterances.issue_term}')
|
||||
let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||
ele.setAttribute('theme', nowTheme)
|
||||
ele.setAttribute('crossorigin', 'anonymous')
|
||||
ele.setAttribute('async', 'true')
|
||||
document.getElementById('utterances-wrap').insertAdjacentElement('afterbegin',ele)
|
||||
}
|
||||
if (document.getElementById('utterances-wrap')) {
|
||||
function loadUtterances () {
|
||||
let ele = document.createElement('script')
|
||||
ele.setAttribute('id', 'utterances_comment')
|
||||
ele.setAttribute('src', '!{url_for(theme.CDN.utterances)}')
|
||||
ele.setAttribute('repo', '!{theme.utterances.repo}')
|
||||
ele.setAttribute('issue-term', '!{theme.utterances.issue_term}')
|
||||
let nowTheme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||
ele.setAttribute('theme', nowTheme)
|
||||
ele.setAttribute('crossorigin', 'anonymous')
|
||||
ele.setAttribute('async', 'true')
|
||||
document.getElementById('utterances-wrap').insertAdjacentElement('afterbegin',ele)
|
||||
}
|
||||
|
||||
if ('!{defaultComment}' === 'Utterances' || !{theme.comments.load_begin}) {
|
||||
window.addEventListener('load', loadUtterances)
|
||||
}
|
||||
else {
|
||||
function loadOtherComment () {
|
||||
if ('!{defaultComment}' === 'Utterances' || !{theme.comments.load_begin}) {
|
||||
loadUtterances()
|
||||
}
|
||||
else {
|
||||
function loadOtherComment () {
|
||||
loadUtterances()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if theme.darkmode.enable
|
||||
script.
|
||||
function utterancesTheme () {
|
||||
var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||
const message = {
|
||||
type: 'set-theme',
|
||||
theme: theme
|
||||
};
|
||||
const iframe = document.querySelector('.utterances-frame');
|
||||
iframe.contentWindow.postMessage(message, 'https://utteranc.es');
|
||||
var theme = document.documentElement.getAttribute('data-theme') === 'dark' ? '#{theme.utterances.dark_theme}' : '#{theme.utterances.light_theme}'
|
||||
const message = {
|
||||
type: 'set-theme',
|
||||
theme: theme
|
||||
};
|
||||
const iframe = document.querySelector('.utterances-frame');
|
||||
iframe.contentWindow.postMessage(message, 'https://utteranc.es');
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
if page.comments !== false && theme.comments.use && theme.comments.use.includes('Facebook Comments')
|
||||
if theme.facebook_comments.app_id
|
||||
meta(property="fb:app_id" content=theme.facebook_comments.app_id )
|
||||
if theme.facebook_comments.user_id
|
||||
meta(property="fb:admins" content=theme.facebook_comments.user_id)
|
@ -1,130 +0,0 @@
|
||||
if theme.subtitle.enable
|
||||
- var source = theme.subtitle.source
|
||||
- var subtitleEffect = theme.subtitle.effect
|
||||
|
||||
if subtitleEffect
|
||||
script(src=url_for(theme.CDN.typed))
|
||||
|
||||
if source == '1'
|
||||
script.
|
||||
var subtitleType = function () {
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
fetch('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json',)
|
||||
.then(function (res) {
|
||||
return res.json()
|
||||
})
|
||||
.then(function (data) {
|
||||
if (subtitleEffect) {
|
||||
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,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = data.text
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
window.addEventListener('load', subtitleType)
|
||||
|
||||
else if source == '2'
|
||||
script.
|
||||
var subtitleType = function () {
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
fetch('https://v1.hitokoto.cn')
|
||||
.then(function (res) {
|
||||
return res.json()
|
||||
})
|
||||
.then(function (data) {
|
||||
if (subtitleEffect) {
|
||||
var from = '出自 ' + data.from
|
||||
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,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = data.hitokoto
|
||||
}
|
||||
})
|
||||
.catch(function (err) {
|
||||
console.error(err)
|
||||
})
|
||||
}
|
||||
window.addEventListener('load', subtitleType)
|
||||
|
||||
else if source == '3'
|
||||
script.
|
||||
var subtitleType = function () {
|
||||
loadScript('http://yijuzhan.com/api/word.php?m=js', function () {
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
var con = str[0]
|
||||
if (subtitleEffect) {
|
||||
var from = '出自 ' + str[1]
|
||||
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,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = con
|
||||
}
|
||||
})
|
||||
}
|
||||
window.addEventListener('load', subtitleType)
|
||||
|
||||
else if source == '4'
|
||||
script.
|
||||
var subtitleType = function () {
|
||||
loadScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js',function () {
|
||||
var subtitleEffect = !{ subtitleEffect }
|
||||
jinrishici.load(function (result) {
|
||||
if (subtitleEffect) {
|
||||
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', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = result.data.content
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
window.addEventListener('load', subtitleType)
|
||||
|
||||
else
|
||||
script.
|
||||
var subtitleEffect = !{subtitleEffect}
|
||||
if (subtitleEffect) {
|
||||
var typed = new Typed("#subtitle", {
|
||||
strings: "!{theme.subtitle.sub}".split(","),
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50
|
||||
})
|
||||
} else {
|
||||
document.getElementById("subtitle").innerHTML = '!{theme.subtitle.sub[0]}'
|
||||
}
|
@ -1,27 +1,45 @@
|
||||
script(type="text/x-mathjax-config").
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {
|
||||
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
|
||||
processEscapes: true,
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
|
||||
},
|
||||
CommonHTML: {
|
||||
linebreaks: { automatic: true, width: "90% container" }
|
||||
},
|
||||
"HTML-CSS": {
|
||||
linebreaks: { automatic: true, width: "90% container" }
|
||||
},
|
||||
"SVG": {
|
||||
linebreaks: { automatic: true, width: "90% container" }
|
||||
}
|
||||
});
|
||||
//- Mathjax 3
|
||||
//- http://docs.mathjax.org/en/latest/upgrading/v2.html#changes-in-the-mathjax-api
|
||||
//- https://github.com/mathjax/MathJax/issues/2209
|
||||
//- http://docs.mathjax.org/en/latest/options/input/tex.html#the-configuration-block
|
||||
//- http://docs.mathjax.org/en/latest/web/typeset.html#resetting-automatic-equation-numbering
|
||||
|
||||
script(type="text/x-mathjax-config").
|
||||
MathJax.Hub.Queue(function() {
|
||||
var all = MathJax.Hub.getAllJax(), i;
|
||||
for (i=0; i < all.length; i += 1) {
|
||||
all[i].SourceElement().parentNode.className += ' has-jax';
|
||||
script.
|
||||
if (!window.MathJax) {
|
||||
window.MathJax = {
|
||||
loader: {
|
||||
source: {
|
||||
'[tex]/amsCd': '[tex]/amscd'
|
||||
}
|
||||
},
|
||||
tex: {
|
||||
inlineMath: [ ['$','$'], ["\\(","\\)"]],
|
||||
tags: 'ams'
|
||||
},
|
||||
options: {
|
||||
renderActions: {
|
||||
findScript: [10, doc => {
|
||||
for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
|
||||
const display = !!node.type.match(/; *mode=display/)
|
||||
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display)
|
||||
const text = document.createTextNode('')
|
||||
node.parentNode.replaceChild(text, node)
|
||||
math.start = {node: text, delim: '', n: 0}
|
||||
math.end = {node: text, delim: '', n: 0}
|
||||
doc.math.push(math)
|
||||
}
|
||||
}, '']
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
script(src=theme.CDN.mathjax)
|
||||
|
||||
var script = document.createElement('script')
|
||||
script.src = '!{theme.CDN.mathjax}'
|
||||
script.id = 'MathJax-script'
|
||||
script.async = true
|
||||
document.head.appendChild(script)
|
||||
} else {
|
||||
MathJax.startup.document.state(0)
|
||||
MathJax.texReset()
|
||||
MathJax.typeset()
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
script.
|
||||
if (document.getElementsByClassName('mermaid').length) {
|
||||
loadScript('!{theme.CDN.mermaid}',function () {
|
||||
mermaid.initialize({
|
||||
theme: '!{theme.mermaid.theme}',
|
||||
})
|
||||
})
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
.post_share
|
||||
if theme.addThis.enable
|
||||
include ./add-this.pug
|
||||
!=partial('includes/share/add-this', {}, {cache:theme.fragment_cache})
|
||||
else if theme.sharejs && theme.sharejs.enable
|
||||
include ./share-js.pug
|
||||
else if theme.addtoany.enable
|
||||
include ./addtoany.pug
|
||||
!=partial('includes/share/addtoany', {}, {cache:theme.fragment_cache})
|
||||
|
@ -0,0 +1,15 @@
|
||||
script.
|
||||
if (document.getElementsByClassName('mermaid').length) {
|
||||
if (window.mermaidJsLoad) mermaid.init()
|
||||
else {
|
||||
$.getScript('!{theme.CDN.mermaid}', function () {
|
||||
window.mermaidJsLoad = true
|
||||
mermaid.initialize({
|
||||
theme: '!{theme.mermaid.theme}',
|
||||
})
|
||||
!{theme.pjax} && mermaid.init()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,12 +1,19 @@
|
||||
script(src=url_for(theme.CDN.pangu))
|
||||
if theme.pangu.field === 'post' && is_post()
|
||||
script.
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
pangu.autoSpacingPage()
|
||||
})
|
||||
else if theme.pangu.field === 'site'
|
||||
script.
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
pangu.autoSpacingPage()
|
||||
})
|
||||
script.
|
||||
function panguFn () {
|
||||
if (typeof pangu === 'object') pangu.spacingElementById('content-inner')
|
||||
else {
|
||||
$.getScript('!{url_for(theme.CDN.pangu)}', () => {
|
||||
pangu.spacingElementById('content-inner')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function panguInit () {
|
||||
if (!{theme.pangu.field === 'post'}){
|
||||
GLOBAL_CONFIG_SITE.isPost && panguFn()
|
||||
} else {
|
||||
panguFn()
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', panguFn)
|
||||
|
@ -0,0 +1,51 @@
|
||||
script(src=url_for(theme.CDN.pjax))
|
||||
script.
|
||||
var pjax = new Pjax({
|
||||
selectors: [
|
||||
'title',
|
||||
'meta[name=description]',
|
||||
'#config_change',
|
||||
'#body-wrap',
|
||||
'#rightside',
|
||||
'.js-pjax'
|
||||
],
|
||||
cacheBust: false,
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:complete', function () {
|
||||
refreshFn()
|
||||
|
||||
$('script[data-pjax]').each(function () {
|
||||
$(this).parent().append($(this).remove())
|
||||
})
|
||||
|
||||
GLOBAL_CONFIG.islazyload && lazyLoadInstance.update()
|
||||
|
||||
typeof chatBtnFn === 'function' && chatBtnFn()
|
||||
typeof panguInit === 'function' && panguInit()
|
||||
|
||||
if (typeof gtag === 'function') {
|
||||
gtag('config', '!{theme.google_analytics}', {'page_path': window.location.pathname});
|
||||
}
|
||||
|
||||
if (document.getElementsByClassName('aplayer').length){
|
||||
loadMeting()
|
||||
}
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:send', function () {
|
||||
if (window.aplayers) {
|
||||
for (let i = 0; i < window.aplayers.length; i++) {
|
||||
if (!window.aplayers[i].options.fixed) window.aplayers[i].destroy()
|
||||
}
|
||||
}
|
||||
|
||||
$(window).off('scroll')
|
||||
|
||||
//reset readmode
|
||||
$('body').hasClass('read-mode') && $('body').removeClass('read-mode')
|
||||
|
||||
//reset font-size
|
||||
$('body').css('font-size') !== originFontSize && $('body').css('font-size', parseFloat(originFontSize))
|
||||
})
|
||||
|
@ -0,0 +1,137 @@
|
||||
- var source = theme.subtitle.source
|
||||
if source == '1'
|
||||
script.
|
||||
function subtitleType () {
|
||||
$.getJSON('https://api.btstu.cn/yan/api.php?charset=utf-8&encode=json',function (data) {
|
||||
if (!{theme.subtitle.effect}) {
|
||||
var sub = "!{theme.subtitle.sub}".length == 0 ? new Array() : "!{theme.subtitle.sub}".split(',')
|
||||
var both = sub.unshift(data.text)
|
||||
typed = new Typed('#subtitle', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = data.text
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') subtitleType()
|
||||
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
|
||||
else if source == '2'
|
||||
script.
|
||||
function subtitleType () {
|
||||
$.getJSON('https://v1.hitokoto.cn', function (data) {
|
||||
if (!{theme.subtitle.effect}) {
|
||||
var from = '出自 ' + data.from
|
||||
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,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = data.hitokoto
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') subtitleType()
|
||||
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
|
||||
else if source == '3'
|
||||
script.
|
||||
function subtitleType () {
|
||||
$.getScript('http://yijuzhan.com/api/word.php?m=js', function () {
|
||||
var con = str[0]
|
||||
if (!{theme.subtitle.effect}) {
|
||||
var from = '出自 ' + str[1]
|
||||
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,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = con
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') subtitleType()
|
||||
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
|
||||
else if source == '4'
|
||||
script.
|
||||
function subtitleType () {
|
||||
$.getScript('https://sdk.jinrishici.com/v2/browser/jinrishici.js',function () {
|
||||
jinrishici.load(function (result) {
|
||||
if (!{theme.subtitle.effect}) {
|
||||
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', {
|
||||
strings: sub,
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50,
|
||||
})
|
||||
} else {
|
||||
document.getElementById('subtitle').innerHTML = result.data.content
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') subtitleType()
|
||||
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
||||
|
||||
else
|
||||
script.
|
||||
function subtitleType () {
|
||||
if (!{theme.subtitle.effect}) {
|
||||
var typed = new Typed("#subtitle", {
|
||||
strings: "!{theme.subtitle.sub}".split(","),
|
||||
startDelay: 300,
|
||||
typeSpeed: 150,
|
||||
loop: !{theme.subtitle.loop},
|
||||
backSpeed: 50
|
||||
})
|
||||
} else {
|
||||
document.getElementById("subtitle").innerHTML = '!{theme.subtitle.sub[0]}'
|
||||
}
|
||||
}
|
||||
|
||||
if (!{theme.subtitle.effect}) {
|
||||
if (typeof Typed === 'function') subtitleType()
|
||||
else $.getScript('!{url_for(theme.CDN.typed)}', subtitleType)
|
||||
} else {
|
||||
subtitleType()
|
||||
}
|
@ -1,73 +1,78 @@
|
||||
// For diff highlight
|
||||
pre .deletion
|
||||
color: $highlight-deletion
|
||||
figure.highlight
|
||||
table
|
||||
&::-webkit-scrollbar-thumb
|
||||
background: $highlight-scrollbar
|
||||
|
||||
pre .deletion
|
||||
color: $highlight-deletion
|
||||
|
||||
pre .addition
|
||||
color: $highlight-addition
|
||||
pre .addition
|
||||
color: $highlight-addition
|
||||
|
||||
pre .meta
|
||||
color: $highlight-purple
|
||||
pre .meta
|
||||
color: $highlight-purple
|
||||
|
||||
pre
|
||||
.comment
|
||||
color: $highlight-comment
|
||||
pre
|
||||
.comment
|
||||
color: $highlight-comment
|
||||
|
||||
.variable,
|
||||
.attribute,
|
||||
.regexp,
|
||||
.ruby .constant,
|
||||
.xml .tag .title,
|
||||
.xml .pi,
|
||||
.xml .doctype,
|
||||
.html .doctype,
|
||||
.css .id,
|
||||
.tag .name,
|
||||
.css .class,
|
||||
.css .pseudo
|
||||
color: $highlight-red
|
||||
.variable,
|
||||
.attribute,
|
||||
.regexp,
|
||||
.ruby .constant,
|
||||
.xml .tag .title,
|
||||
.xml .pi,
|
||||
.xml .doctype,
|
||||
.html .doctype,
|
||||
.css .id,
|
||||
.tag .name,
|
||||
.css .class,
|
||||
.css .pseudo
|
||||
color: $highlight-red
|
||||
|
||||
.tag
|
||||
color: $highlight-aqua
|
||||
.tag
|
||||
color: $highlight-aqua
|
||||
|
||||
.number,
|
||||
.preprocessor,
|
||||
.literal,
|
||||
.params,
|
||||
.constant,
|
||||
.command
|
||||
color: $highlight-orange
|
||||
.number,
|
||||
.preprocessor,
|
||||
.literal,
|
||||
.params,
|
||||
.constant,
|
||||
.command
|
||||
color: $highlight-orange
|
||||
|
||||
.built_in
|
||||
color: $highlight-yellow
|
||||
.built_in
|
||||
color: $highlight-yellow
|
||||
|
||||
.ruby .class .title,
|
||||
.css .rules .attribute,
|
||||
.string,
|
||||
.value,
|
||||
.inheritance,
|
||||
.header,
|
||||
.ruby .symbol,
|
||||
.xml .cdata,
|
||||
.special,
|
||||
.number,
|
||||
.formula
|
||||
color: $highlight-green
|
||||
.ruby .class .title,
|
||||
.css .rules .attribute,
|
||||
.string,
|
||||
.value,
|
||||
.inheritance,
|
||||
.header,
|
||||
.ruby .symbol,
|
||||
.xml .cdata,
|
||||
.special,
|
||||
.number,
|
||||
.formula
|
||||
color: $highlight-green
|
||||
|
||||
.keyword,
|
||||
.title,
|
||||
.css .hexcolor
|
||||
color: $highlight-aqua
|
||||
.keyword,
|
||||
.title,
|
||||
.css .hexcolor
|
||||
color: $highlight-aqua
|
||||
|
||||
.function,
|
||||
.python .decorator,
|
||||
.python .title,
|
||||
.ruby .function .title,
|
||||
.ruby .title .keyword,
|
||||
.perl .sub,
|
||||
.javascript .title,
|
||||
.coffeescript .title
|
||||
color: $highlight-blue
|
||||
.function,
|
||||
.python .decorator,
|
||||
.python .title,
|
||||
.ruby .function .title,
|
||||
.ruby .title .keyword,
|
||||
.perl .sub,
|
||||
.javascript .title,
|
||||
.coffeescript .title
|
||||
color: $highlight-blue
|
||||
|
||||
.tag .attr,
|
||||
.javascript .function
|
||||
color: $highlight-purple
|
||||
.tag .attr,
|
||||
.javascript .function
|
||||
color: $highlight-purple
|
||||
|
@ -1 +1,180 @@
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
||||
html {
|
||||
line-height: 1.15;
|
||||
-webkit-text-size-adjust: 100%
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0
|
||||
}
|
||||
|
||||
main {
|
||||
display: block
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin: .67em 0
|
||||
}
|
||||
|
||||
hr {
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible
|
||||
}
|
||||
|
||||
pre {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em
|
||||
}
|
||||
|
||||
a {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: none;
|
||||
text-decoration: underline;
|
||||
text-decoration: underline dotted
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder
|
||||
}
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 1em
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 80%
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -.25em
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -.5em
|
||||
}
|
||||
|
||||
img {
|
||||
border-style: none
|
||||
}
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit;
|
||||
font-size: 100%;
|
||||
line-height: 1.15;
|
||||
margin: 0
|
||||
}
|
||||
|
||||
button,
|
||||
input {
|
||||
overflow: visible
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none
|
||||
}
|
||||
|
||||
[type=button],
|
||||
[type=reset],
|
||||
[type=submit],
|
||||
button {
|
||||
-webkit-appearance: button
|
||||
}
|
||||
|
||||
[type=button]::-moz-focus-inner,
|
||||
[type=reset]::-moz-focus-inner,
|
||||
[type=submit]::-moz-focus-inner,
|
||||
button::-moz-focus-inner {
|
||||
border-style: none;
|
||||
padding: 0
|
||||
}
|
||||
|
||||
[type=button]:-moz-focusring,
|
||||
[type=reset]:-moz-focusring,
|
||||
[type=submit]:-moz-focusring,
|
||||
button:-moz-focusring {
|
||||
outline: 1px dotted ButtonText
|
||||
}
|
||||
|
||||
fieldset {
|
||||
padding: .35em .75em .625em
|
||||
}
|
||||
|
||||
legend {
|
||||
box-sizing: border-box;
|
||||
color: inherit;
|
||||
display: table;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
white-space: normal
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow: auto
|
||||
}
|
||||
|
||||
[type=checkbox],
|
||||
[type=radio] {
|
||||
box-sizing: border-box;
|
||||
padding: 0
|
||||
}
|
||||
|
||||
[type=number]::-webkit-inner-spin-button,
|
||||
[type=number]::-webkit-outer-spin-button {
|
||||
height: auto
|
||||
}
|
||||
|
||||
[type=search] {
|
||||
-webkit-appearance: textfield;
|
||||
outline-offset: -2px
|
||||
}
|
||||
|
||||
[type=search]::-webkit-search-decoration {
|
||||
-webkit-appearance: none
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
font: inherit
|
||||
}
|
||||
|
||||
details {
|
||||
display: block
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item
|
||||
}
|
||||
|
||||
template {
|
||||
display: none
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue