From 74f1bdbd84331111b7170bee8d7706e2fa032a6e Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sun, 24 Mar 2019 00:16:25 +0800 Subject: [PATCH] update --- _config.yml | 2 +- layout/_partial/scripts.ejs | 254 ++++++++++++++++++------------------ source/js/clipboard-use.js | 73 ++++++++++- source/js/clipboard.min.js | 4 - source/less/_article.less | 74 +++++------ source/less/_layout.less | 3 +- source/less/_main.less | 38 ++++++ source/less/_search.less | 1 + 8 files changed, 272 insertions(+), 177 deletions(-) delete mode 100644 source/js/clipboard.min.js diff --git a/_config.yml b/_config.yml index 2ef3771..bf789dd 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@19.3.22/ + cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.3.24/ ############################### 主题样式 ############################### diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index a40bfac..5a83ee7 100755 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -15,142 +15,144 @@ if(!ROOT.endsWith('/'))ROOT += '/'; <% } %> -<% if (theme.services) { %> - <% if (theme.services.scrollreveal == true) { %> - - - <% } %> - <% if (theme.services.nodewaves == true) { %> - - - <% } %> - <% if (theme.services.busuanzi == true) { %> - - <% } %> - <% if (theme.services.fastclick == true) { %> - - - - <% } %> - <% if (theme.services.share == true && config.mob && config.mob.app_key) { %> - <% if (page.layout == 'post' && page.share != false) { %> - - <% } %> + +<% if (theme.services.scrollreveal == true) { %> + + +<% } %> +<% if (theme.services.nodewaves == true) { %> + + +<% } %> +<% if (theme.services.busuanzi == true) { %> + +<% } %> +<% if (theme.services.fastclick == true) { %> + + + +<% } %> +<% if (theme.services.share == true && config.mob && config.mob.app_key) { %> + <% if (page.layout == 'post' && page.share != false) { %> + <% } %> +<% } %> - <% - var enableDisqus = false; - var enableLivere = false; - var enableValine = false; - if (page && theme.services && theme.services.comments == true && page.comments != false) { - if (config.disqus_shortname) { - enableDisqus = true; - } - if (config.livere_uid) { - enableLivere = true; - } - if (config.valine && config.valine.app_id && config.valine.app_key) { - enableValine = true; - } +<% + var enableDisqus = false; + var enableLivere = false; + var enableValine = false; + if (page && theme.services && theme.services.comments == true && page.comments != false) { + if (config.disqus_shortname) { + enableDisqus = true; } - %> - <% if (enableDisqus){ %> - - <% } %> - <% if (enableLivere){ %> - - <% } %> - <% if (enableValine){ %> - - <% if (theme.services.volantis == true) { %> - <% if (theme.services && theme.services.cdn == true) { %> - - <% } else { %> - <%- js('js/volantis.js') %> - <% } %> + if (config.livere_uid) { + enableLivere = true; + } + if (config.valine && config.valine.app_id && config.valine.app_key) { + enableValine = true; + } + } +%> +<% if (enableDisqus){ %> + +<% } %> +<% if (enableLivere){ %> + +<% } %> +<% if (enableValine){ %> + + <% if (theme.services.volantis == true) { %> + <% if (theme.services && theme.services.cdn == true) { %> + <% } else { %> - + <%- js('js/volantis.js') %> <% } %> - + <% } else { %> + <% } %> - - <% 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']) %> + +<% } %> + + + +<% 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', theme.info.cdn + 'js/clipboard-use.js']) %> + <% } else if (config.theme_cdn.length > 0) { %> + <%- js([config.theme_cdn + 'js/app.js', config.theme_cdn + 'js/search.js', config.theme_cdn + 'js/clipboard-use.js']) %> <% } %> +<% } else { %> + <%- js(['js/app.js', 'js/search.js', 'js/clipboard-use.js']) %> <% } %> + <% if (page.layout == 'links') { %> <%- js('https://cdn.jsdelivr.net/gh/toddmotto/echo@1.7.3/src/echo.js') %>