fix: fixed a bug where users could not use their own images
This commit is contained in:
parent
12cd54d256
commit
3d47319a94
|
@ -14,6 +14,12 @@ style:
|
|||
# Theme primary color
|
||||
primary_color: '#0066CC'
|
||||
|
||||
# Avatar (You can use local image or image external link)
|
||||
avatar: images/avatar.png
|
||||
|
||||
# Favicon (You can use local image or image external link)
|
||||
favicon: images/logo.svg
|
||||
|
||||
# Image align position, value: left | center
|
||||
img_position: left
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<% } %>
|
||||
<%= theme.base_info.title || config.title || 'Keep' %>
|
||||
</title>
|
||||
<%- __favicon_tag('images/logo.svg') %>
|
||||
<%- favicon_tag(theme.style.favicon) %>
|
||||
<%- css('css/style') %>
|
||||
<%- __css('css/font-awesome.min.css') %>
|
||||
<%- export_config() %>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<% if (theme.base_info.author || config.author) { %>
|
||||
<div class="article-header">
|
||||
<div class="avatar">
|
||||
<%- __image_tag('images/avatar.png') %>
|
||||
<%- image_tag(theme.style.avatar) %>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="author">
|
||||
|
|
|
@ -73,22 +73,3 @@ hexo.extend.helper.register('__css', function (path) {
|
|||
return _css(path);
|
||||
}
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('__favicon_tag', function (path) {
|
||||
const _favicon_tag = hexo.extend.helper.get('favicon_tag').bind(hexo);
|
||||
if (this.theme.cdn.enable) {
|
||||
return `<link rel="icon" href="//cdn.jsdelivr.net/npm/hexo-theme-keep@${this.theme.version}/source/${path}">`
|
||||
} else {
|
||||
return _favicon_tag(path);
|
||||
}
|
||||
});
|
||||
|
||||
hexo.extend.helper.register('__image_tag', function (path) {
|
||||
const _image_tag = hexo.extend.helper.get('image_tag').bind(hexo);
|
||||
if (this.theme.cdn.enable) {
|
||||
return `<img src="//cdn.jsdelivr.net/npm/hexo-theme-keep@${this.theme.version}/source/${path}">`
|
||||
} else {
|
||||
return _image_tag(path);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue