perf: modified JS and CSS reference paths
This commit is contained in:
parent
2c27ba7bcf
commit
dc5e936b13
|
@ -27,8 +27,8 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<%= 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">
|
||||||
<%- favicon_tag(theme.style.favicon) %>
|
<%- favicon_tag(theme.style.favicon) %>
|
||||||
<%- css('css/style') %>
|
|
||||||
<%- __css('css/font-awesome.min.css') %>
|
<%- __css('css/font-awesome.min.css') %>
|
||||||
<%- export_config() %>
|
<%- export_config() %>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -44,12 +44,9 @@ hexo.extend.helper.register('getPostUrl', function (rootUrl, path) {
|
||||||
hexo.extend.helper.register('__js', function (path) {
|
hexo.extend.helper.register('__js', function (path) {
|
||||||
|
|
||||||
const cdnPathHandle = (path_2) => {
|
const cdnPathHandle = (path_2) => {
|
||||||
|
|
||||||
const _js = hexo.extend.helper.get('js').bind(hexo);
|
|
||||||
|
|
||||||
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>`
|
||||||
: _js(path_2)
|
: `<script src="/${path_2}"></script>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
let t = ``;
|
let t = ``;
|
||||||
|
@ -66,10 +63,9 @@ 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 _css(path);
|
return `<link rel="stylesheet" href="/${path}">`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue