Update Theme

This commit is contained in:
186526 2020-12-31 21:55:05 +08:00
parent 89c48059d0
commit 43445049e5
Signed by untrusted user: 186526
GPG Key ID: C7EB1E6B8CC5E51D
4 changed files with 20 additions and 13 deletions

View File

@ -1,4 +1,13 @@
<div class="post-container pjax">
<%- fragment_cache('head_hljs_css', () => {
let html = '';
if (theme.vendors.suka.highlight_theme) {
html += css_async(theme.vendors.suka.highlight_theme);
} else if (theme.highlight.theme) {
html += css_async(url_for('css/highlight/' + theme.highlight.theme + '.min.css'));
}
return html;
}) %>
<div id="post-card" class="card">
<% if (page.thumbnail) { %>
<div class="card-image lazyload" data-bg="url('<%= page.thumbnail %>')"></div>

View File

@ -37,12 +37,6 @@
<%- partial('_plugin/highlight/prettify/theme') %>
<% } %>
<% if (config.highlight.enable) { %>
<!-- Prettify Theme -->
<%- partial('_plugin/highlight/hexo-hljs/theme') %>
<% } %>
<script>
/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */
!function(t){"use strict";t.loadCSS||(t.loadCSS=function(){});var e=loadCSS.relpreload={};if(e.support=function(){var e;try{e=t.document.createElement("link").relList.supports("preload")}catch(t){e=!1}return function(){return e}}(),e.bindMediaToggle=function(t){var e=t.media||"all";function a(){t.addEventListener?t.removeEventListener("load",a):t.attachEvent&&t.detachEvent("onload",a),t.setAttribute("onload",null),t.media=e}t.addEventListener?t.addEventListener("load",a):t.attachEvent&&t.attachEvent("onload",a),setTimeout(function(){t.rel="stylesheet",t.media="only x"}),setTimeout(a,3e3)},e.poly=function(){if(!e.support())for(var a=t.document.getElementsByTagName("link"),n=0;n<a.length;n++){var o=a[n];"preload"!==o.rel||"style"!==o.getAttribute("as")||o.getAttribute("data-loadcss")||(o.setAttribute("data-loadcss",!0),e.bindMediaToggle(o))}},!e.support()){e.poly();var a=t.setInterval(e.poly,500);t.addEventListener?t.addEventListener("load",function(){e.poly(),t.clearInterval(a)}):t.attachEvent&&t.attachEvent("onload",function(){e.poly(),t.clearInterval(a)})}"undefined"!=typeof exports?exports.loadCSS=loadCSS:t.loadCSS=loadCSS}("undefined"!=typeof global?global:this);

View File

@ -1,4 +1,7 @@
<div id="vcomments">Loading……<noscript>启动js来查看评论</noscript></div>
<div id="vcomments">Loading……
<a onclick="window.valinenow();">强制加载Valine</a>
<noscript>启动js来查看评论</noscript>
</div>
<!--<script src="https://cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>-->
<!--<script src="https://cdn.jsdelivr.net/npm/valine@latest/dist/Valine.min.js"></script>-->
@ -46,9 +49,8 @@
valinenow();
}
}
window.addEventListener('load', () => {
valinedo();
});
document.dispatchEvent(new window.Event("LoadValine"));
valinedo();
if(!window.whenAvailable){
let whenAvailable = (name, callback) => {
var interval = 100;

View File

@ -64,14 +64,16 @@ let suc = () => {
whenAvailable("LazyLoad", () => {
new LazyLoad();
});
if (window.valinedo) {
valinedo();
}
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-ENYRL7T64N');
};
document.addEventListener('LoadValine',()=>{
if(document.querySelector("#vcomments")){
valinedo();
}
});
let whenAvailable = (name, callback) => {
var interval = 100;
window.setTimeout(function () {