From 82eebcda821fdb348ddb7915e5d276a0b37b675f Mon Sep 17 00:00:00 2001 From: XPoet Date: Mon, 29 Mar 2021 10:22:56 +0800 Subject: [PATCH] fixed theme resource reference path error (#77) --- layout/_partial/head.ejs | 2 +- scripts/helpers/helper.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index f865e83..43573db 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -27,7 +27,7 @@ <% } %> <%= theme.base_info.title || config.title || 'Keep Theme' %> - + <%- css('css/style') %> <%- favicon_tag(theme.style.favicon) %> <%- __css('css/font-awesome.min.css') %> <%- export_config() %> diff --git a/scripts/helpers/helper.js b/scripts/helpers/helper.js index 9217f6d..a15bc35 100644 --- a/scripts/helpers/helper.js +++ b/scripts/helpers/helper.js @@ -51,11 +51,11 @@ hexo.extend.helper.register('getPostUrl', function (rootUrl, path) { }); hexo.extend.helper.register('__js', function (path) { - + const _js = hexo.extend.helper.get('js').bind(hexo); const cdnPathHandle = (path_2) => { return this.theme.cdn.enable ? `` - : ``; + : _js(path_2); } let t = ``; @@ -72,9 +72,10 @@ 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 `` + return _css(path); } });