diff --git a/_config.yml b/_config.yml index e642d12..bfaed82 100644 --- a/_config.yml +++ b/_config.yml @@ -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 diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 9f013aa..f238e36 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -23,7 +23,7 @@ <% } %> <%= theme.base_info.title || config.title || 'Keep' %> - <%- __favicon_tag('images/logo.svg') %> + <%- favicon_tag(theme.style.favicon) %> <%- css('css/style') %> <%- __css('css/font-awesome.min.css') %> <%- export_config() %> diff --git a/layout/article-content.ejs b/layout/article-content.ejs index 431bcd5..608f69b 100644 --- a/layout/article-content.ejs +++ b/layout/article-content.ejs @@ -8,7 +8,7 @@ <% if (theme.base_info.author || config.author) { %>
- <%- __image_tag('images/avatar.png') %> + <%- image_tag(theme.style.avatar) %>
diff --git a/scripts/helpers/helper.js b/scripts/helpers/helper.js index af03c19..d023d9d 100644 --- a/scripts/helpers/helper.js +++ b/scripts/helpers/helper.js @@ -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 `` - } 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 `` - } else { - return _image_tag(path); - } -}); -