From d578dc59d3b151d9828c29d95de52b1c71e5968e Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sat, 29 Dec 2018 00:04:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0config.theme=5Fcdn=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _config.yml | 2 +- layout/_partial/article.ejs | 31 +++++++++++++++++-------------- layout/_partial/head.ejs | 8 ++++++-- layout/_partial/scripts.ejs | 6 +++++- source/less/_header.less | 1 + 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/_config.yml b/_config.yml index 29b6c53..7ea8d7c 100755 --- a/_config.yml +++ b/_config.yml @@ -8,7 +8,7 @@ info: name: Material X docs: https://xaoxuu.com/wiki/material-x/ # 主题的CDN地址。如需启用CDN,请在主目录的config中设置,详见文档。 - cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@18.12.40/ + cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@18.12.41/ ############################### 主题样式 ############################### diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs index 9506e08..7611055 100755 --- a/layout/_partial/article.ejs +++ b/layout/_partial/article.ejs @@ -1,23 +1,26 @@
<%- partial('meta',{post:post}) %>
- -
- <%- post.content %> -
+
+ <%- post.content %> +
<% if(post.layout == 'post'){ %> <% } %> diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 4535ba7..946b67f 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -59,8 +59,12 @@ <% }) %> <% } %> - <% if (theme.services && theme.services.cdn == true) { %> - <%- css(theme.info.cdn + 'css/style.css') %> + <% if (theme.services && theme.services.cdn == true && config.theme_cdn) { %> + <% if (config.theme_cdn == true) { %> + <%- css(theme.info.cdn + 'css/style.css') %> + <% } else if (config.theme_cdn.length > 0) { %> + <%- css(config.theme_cdn + 'css/style.css') %> + <% } %> <% } else { %> <%- css('style.css') %> <% } %> diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index 9c6eaf3..dab5734 100755 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -243,8 +243,12 @@ <% } %> <% } %> <% } %> - <% if (theme.services.cdn == true) { %> + <% if (theme.services.cdn == true && config.theme_cdn) { %> + <% if (config.theme_cdn == true) { %> <%- js([theme.info.cdn + 'js/app.js', theme.info.cdn + 'js/search.js']) %> + <% } else if (config.theme_cdn.length > 0) { %> + <%- js([config.theme_cdn + 'js/app.js', config.theme_cdn + 'js/search.js']) %> + <% } %> <% } else { %> <%- js(['js/app.js', 'js/search.js']) %> <% } %> diff --git a/source/less/_header.less b/source/less/_header.less index 9509219..848158d 100755 --- a/source/less/_header.less +++ b/source/less/_header.less @@ -326,6 +326,7 @@ color: @black; padding: 2px 20px; border-left: 4px solid transparent; + border-right: 4px solid transparent; &:hover,&.active{ border-left: 4px solid @theme_main; background: fade(@theme_main, 10%);