fixed theme resource reference path error (#77)
This commit is contained in:
parent
d2e56096b7
commit
82eebcda82
|
@ -27,7 +27,7 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<%= theme.base_info.title || config.title || 'Keep Theme' %>
|
<%= theme.base_info.title || config.title || 'Keep Theme' %>
|
||||||
</title>
|
</title>
|
||||||
<link rel="stylesheet" href="/css/style.css">
|
<%- css('css/style') %>
|
||||||
<%- favicon_tag(theme.style.favicon) %>
|
<%- favicon_tag(theme.style.favicon) %>
|
||||||
<%- __css('css/font-awesome.min.css') %>
|
<%- __css('css/font-awesome.min.css') %>
|
||||||
<%- export_config() %>
|
<%- export_config() %>
|
||||||
|
|
|
@ -51,11 +51,11 @@ hexo.extend.helper.register('getPostUrl', function (rootUrl, path) {
|
||||||
});
|
});
|
||||||
|
|
||||||
hexo.extend.helper.register('__js', function (path) {
|
hexo.extend.helper.register('__js', function (path) {
|
||||||
|
const _js = hexo.extend.helper.get('js').bind(hexo);
|
||||||
const cdnPathHandle = (path_2) => {
|
const cdnPathHandle = (path_2) => {
|
||||||
return this.theme.cdn.enable
|
return this.theme.cdn.enable
|
||||||
? `<script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@${this.theme.version}/source/${path_2}"></script>`
|
? `<script src="//cdn.jsdelivr.net/npm/hexo-theme-keep@${this.theme.version}/source/${path_2}"></script>`
|
||||||
: `<script src="/${path_2}"></script>`;
|
: _js(path_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
let t = ``;
|
let t = ``;
|
||||||
|
@ -72,9 +72,10 @@ hexo.extend.helper.register('__js', function (path) {
|
||||||
});
|
});
|
||||||
|
|
||||||
hexo.extend.helper.register('__css', function (path) {
|
hexo.extend.helper.register('__css', function (path) {
|
||||||
|
const _css = hexo.extend.helper.get('css').bind(hexo);
|
||||||
if (this.theme.cdn.enable) {
|
if (this.theme.cdn.enable) {
|
||||||
return `<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hexo-theme-keep@${this.theme.version}/source/${path}">`;
|
return `<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/hexo-theme-keep@${this.theme.version}/source/${path}">`;
|
||||||
} else {
|
} else {
|
||||||
return `<link rel="stylesheet" href="/${path}">`
|
return _css(path);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue