diff --git a/_config.yml b/_config.yml index 0ca59a0..5c5608a 100755 --- a/_config.yml +++ b/_config.yml @@ -2,7 +2,14 @@ info: name: Material X docs: https://xaoxuu.com/wiki/material-x/ - cdn: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.6/ + cdn: + css: + # style: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.6/css/style.css + js: + app: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.6/js/app.js + search: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-material-x@19.4.6/js/search.js + volantis: https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1/js/volantis.min.js + ############################### 主题样式 ############################### @@ -11,8 +18,8 @@ style: pure # pure: 导航栏和标题栏背景是白色 ############################### 服务开关 ############################### -services: - # cdn: true + +services: scrollreveal: true nodewaves: true busuanzi: true diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 2e354fc..ee55832 100755 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -58,11 +58,11 @@ <% if (config.favicon) { %> <% } %> - - <% if (theme.services.cdn == true) { %> - <%- css(theme.info.cdn + 'css/style.css') %> + + <% if (theme.info && theme.info.cdn && theme.info.cdn.css && theme.info.cdn.css.style) { %> + <%- css(theme.info.cdn.css.style) %> <% } else { %> - <%- css('style.css') %> + <%- css('style.css') %> <% } %> <% if (theme.valine.volantis == true) { %> - <% if (theme.services.cdn == true) { %> - + <% if (theme.info && theme.info.cdn && theme.info.cdn.js && theme.info.cdn.js.volantis) { %> + <%- js(theme.info.cdn.js.volantis) %> <% } else { %> - <%- js('js/volantis.js') %> + <%- js(['js/volantis.js']) %> <% } %> <% } else { %> @@ -140,13 +140,16 @@ <% } %> - -<% if (theme.services.cdn == true) { %> - <%- js([theme.info.cdn + 'js/app.js', theme.info.cdn + 'js/search.js']) %> +<% if (theme.info && theme.info.cdn && theme.info.cdn.js && theme.info.cdn.js.app) { %> + <%- js(theme.info.cdn.js.app) %> <% } else { %> - <%- js(['js/app.js', 'js/search.js']) %> + <%- js(['js/app.js']) %> +<% } %> +<% if (theme.info && theme.info.cdn && theme.info.cdn.js && theme.info.cdn.js.search) { %> + <%- js(theme.info.cdn.js.search) %> +<% } else { %> + <%- js(['js/search.js']) %> <% } %> - <% if (page.layout == 'links') { %> <%- js('https://cdn.jsdelivr.net/gh/toddmotto/echo@1.7.3/src/echo.js') %>