+ <%- 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;
+ }) %>
<% if (page.thumbnail) { %>
diff --git a/themes/suka/layout/_partial/source/head.ejs b/themes/suka/layout/_partial/source/head.ejs
index 6f8d759..2f8a920 100644
--- a/themes/suka/layout/_partial/source/head.ejs
+++ b/themes/suka/layout/_partial/source/head.ejs
@@ -37,12 +37,6 @@
<%- partial('_plugin/highlight/prettify/theme') %>
<% } %>
-<% if (config.highlight.enable) { %>
-
- <%- partial('_plugin/highlight/hexo-hljs/theme') %>
-<% } %>
-
-
-->
@@ -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;
diff --git a/themes/suka/source/js/blog-186.js b/themes/suka/source/js/blog-186.js
index ed137ae..b8da55c 100644
--- a/themes/suka/source/js/blog-186.js
+++ b/themes/suka/source/js/blog-186.js
@@ -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 () {