From dc5e936b13d3d538b0bb8b5ee40ef5a11c001780 Mon Sep 17 00:00:00 2001 From: XPoet Date: Fri, 22 Jan 2021 18:36:05 +0800 Subject: [PATCH] perf: modified JS and CSS reference paths --- layout/_partial/head.ejs | 2 +- scripts/helpers/helper.js | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 20bc82e..f865e83 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -27,8 +27,8 @@ <% } %> <%= theme.base_info.title || config.title || 'Keep Theme' %> + <%- favicon_tag(theme.style.favicon) %> - <%- css('css/style') %> <%- __css('css/font-awesome.min.css') %> <%- export_config() %> diff --git a/scripts/helpers/helper.js b/scripts/helpers/helper.js index d023d9d..5a69a7a 100644 --- a/scripts/helpers/helper.js +++ b/scripts/helpers/helper.js @@ -44,12 +44,9 @@ hexo.extend.helper.register('getPostUrl', function (rootUrl, path) { hexo.extend.helper.register('__js', function (path) { const cdnPathHandle = (path_2) => { - - const _js = hexo.extend.helper.get('js').bind(hexo); - return this.theme.cdn.enable - ? `` - : _js(path_2) + ? `` + : ``; } let t = ``; @@ -66,10 +63,9 @@ hexo.extend.helper.register('__js', function (path) { }); hexo.extend.helper.register('__css', function (path) { - const _css = hexo.extend.helper.get('css').bind(hexo); if (this.theme.cdn.enable) { return ``; } else { - return _css(path); + return `` } });