From d2d0c16b2fc3d2f77c96e971e5908184c4708971 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Thu, 27 Dec 2018 11:06:53 +0800 Subject: [PATCH] update --- layout/_partial/head.ejs | 26 +++--- layout/_partial/scripts.ejs | 155 +++++++++++++++---------------- layout/_third-party/comments.ejs | 72 +++++++------- 3 files changed, 123 insertions(+), 130 deletions(-) diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index f3ba48d..a3834f9 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -36,18 +36,21 @@ - - - <% if (config.import && config.import.link){ %> - <% (config.import.link||[]).forEach(function(item){ %> - type="<%= item.type %>"<% } %> <% if (item.sizes){ %>sizes="<%= item.sizes %>"<% } %> href="<%- item.href %>" <% if (item.color){ %>color="<%= item.color %>"<% } %>> - <% }) %> - <% } %> - <% if (config.import && config.import.meta){ %> <% (config.import.meta||[]).forEach(function(item){ %> - + + <% }) %> + <% } %> + + <% if (config.import && config.import.link){ %> + <% (config.import.link||[]).forEach(function(item){ %> + type="<%= item.type %>"<% } %> + <% if (item.sizes){ %> sizes="<%= item.sizes %>"<% } %> + <% if (item.media){ %> media="<%= item.media %>"<% } %> + <% if (item.hreflang){ %> hreflang="<%= item.hreflang %>"<% } %> + <% if (item.color){ %> color="<%= item.color %>"<% } %>> <% }) %> <% } %> @@ -60,11 +63,6 @@ <%- css('style.css') %> <% } %> - <% if (config.import && config.import.google_fonts && config.import.google_fonts.length > 0){ %> - - - <% } %> - diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index 3863cc2..5281179 100755 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -11,24 +11,6 @@ }, false) -<% if (theme.search && theme.search.enable) { %> - -<% } %> - - <% if (config.import && config.import.js == true) { %> <%- js([theme.theme_info.cdn + 'js/app.js', theme.theme_info.cdn + 'js/search.js']) %> <% } else if (config.import && config.import.js && config.import.js.length > 0) { %> @@ -37,72 +19,85 @@ <%- js(['js/app.js', 'js/search.js']) %> <% } %> +<% if (theme.search && theme.search.enable) { %> + +<% } %> -<% if (page.comments) { %> - <% if (config.disqus_shortname){ %> - - <% } %> - <% if (config.livere_uid){ %> - - <% } %> - <% if (config.valine){ %> - <% if (config.valine.enable && config.valine.app_id && config.valine.app_key){ %> - - <% if (config.import && config.import.js == true) { %> - - <% } else { %> - <%- js('js/volantis.js') %> - <% } %> - - - <% } %> +<% if ((page.layout == 'post' && page.comments != false) || page.comments == true) { %> + <% if (config.disqus_shortname){ %> + + <% } %> + <% if (config.livere_uid){ %> + + <% } %> + <% if (config.valine){ %> + <% if (config.valine.enable && config.valine.app_id && config.valine.app_key){ %> + + <% if (config.import && config.import.js == true) { %> + + <% } else { %> + <%- js('js/volantis.js') %> + <% } %> + <% } %> + <% } %> <% } %> - - <% if (config.leancloud_visitors && config.leancloud_visitors.app_id && config.leancloud_visitors.app_key) { %> diff --git a/layout/_third-party/comments.ejs b/layout/_third-party/comments.ejs index 5c0885c..8b1f5f2 100644 --- a/layout/_third-party/comments.ejs +++ b/layout/_third-party/comments.ejs @@ -1,44 +1,44 @@ <% if (page && ((theme.recommended_posts && theme.recommended_posts.autoDisplay == false && page.recommended_posts != false) || (page.comments && (config.disqus_shortname || config.livere_shortname || config.valine)) )) { %> -
-
+
+
- <% if (theme.recommended_posts && theme.recommended_posts.autoDisplay == false && page.recommended_posts != false) { %> - <%- partial('recommended_posts', {page: page, site: site}) %> - <% } %> + <% if (theme.recommended_posts && theme.recommended_posts.autoDisplay == false && page.recommended_posts != false) { %> + <%- partial('recommended_posts', {page: page, site: site}) %> + <% } %> - <% if (page.comments) { %> + <% if (page.comments) { %> -

 评论

- <% if (config.disqus_shortname) { %> -
-
- ⚠️ 无法加载评论系统,请确保您的网络能够正常访问 Disqus 。 -
-
- <% } %> +

 评论

+ <% if (config.disqus_shortname) { %> +
+
+ ⚠️ 无法加载评论系统,请确保您的网络能够正常访问 Disqus 。 +
+
+ <% } %> - <% if (config.livere_uid){ %> -
-
- -
-
- <% } %> + <% if (config.livere_uid){ %> +
+
+ +
+
+ <% } %> - <% if (config.valine){ %> - <% if (config.valine.enable && config.valine.app_id && config.valine.app_key){ %> -
-
文明评论,请勿灌水。为了便于区分和接收回复提醒,请您在留言时填写一下昵称邮箱
-
-
-
- -
-
- <% } %> - <% } %> - <% } %> -
-
+ <% if (config.valine){ %> + <% if (config.valine.enable && config.valine.app_id && config.valine.app_key){ %> +
+
文明评论,请勿灌水。为了便于区分和接收回复提醒,请您在留言时填写一下昵称邮箱
+
+
+
+ +
+
+ <% } %> + <% } %> + <% } %> +
+
<% } %>