diff --git a/layout/_partial/sidebar/index.ejs b/layout/_partial/sidebar/index.ejs
index 0cc80b3..c4c8d45 100755
--- a/layout/_partial/sidebar/index.ejs
+++ b/layout/_partial/sidebar/index.ejs
@@ -115,7 +115,7 @@ function layoutFooterDiv() {
el += ' onclick="' + item.onclick + '"';
}
el += '>';
- el += item.icon;
+ el += icon(item.icon, 'no-lazy')
el += '';
}
}
diff --git a/layout/_partial/sidebar/menu.ejs b/layout/_partial/sidebar/menu.ejs
index 79ac4a1..326da45 100644
--- a/layout/_partial/sidebar/menu.ejs
+++ b/layout/_partial/sidebar/menu.ejs
@@ -12,13 +12,7 @@ function layoutDiv() {
}
el += `>`
if (item.icon?.length > 0) {
- if (item.icon.startsWith('<')) {
- el += item.icon
- } else if (theme.icons[item.icon]) {
- el += theme.icons[item.icon]
- } else {
- el += ``
- }
+ el += icon(item.icon, 'no-lazy')
} else {
el += `${__(item.title)}`
}
diff --git a/scripts/helpers/icon.js b/scripts/helpers/icon.js
index 06d7c83..3c316a6 100644
--- a/scripts/helpers/icon.js
+++ b/scripts/helpers/icon.js
@@ -1,6 +1,6 @@
'use strict';
-hexo.extend.helper.register('icon', function(key) {
+hexo.extend.helper.register('icon', function(key, args) {
const { icons } = hexo.theme.config
var result = ''
if (icons[key]) {
@@ -9,7 +9,7 @@ hexo.extend.helper.register('icon', function(key) {
result = key
}
if (result.startsWith('/') || result.startsWith('https://') || result.startsWith('http://')) {
- return ``
+ return ` 0 ? args : ''} src="${result}" />`
} else {
return result
}