hexo-theme-stellar/layout/_partial/sidebar/menu.ejs

27 lines
694 B
Plaintext
Raw Permalink Normal View History

2022-10-22 13:03:47 +08:00
<%
function layoutDiv() {
2024-01-17 00:27:48 +08:00
var el = ''
el += `<nav class="menu dis-select${where == 'main' ? ' mobile-hidden' : ''}">`
2024-01-20 14:48:04 +08:00
for (let item of (theme.menubar.items || [])) {
2024-01-17 23:39:14 +08:00
if (item == undefined || item.id == null || item.url == null) {
2024-01-17 00:27:48 +08:00
continue
2022-10-22 13:03:47 +08:00
}
2024-01-17 23:39:14 +08:00
el += `<a class="nav-item${item.id == page.menu_id ? ' active' : ''}" title="${item.title}" href="${url_for(item.url)}"`
2024-01-17 22:57:52 +08:00
if (item.theme?.length > 0) {
el += ` style="color:${item.theme}"`
}
el += `>`
2024-01-17 14:07:30 +08:00
if (item.icon?.length > 0) {
2024-01-30 18:08:47 +08:00
el += icon(item.icon, 'no-lazy')
2024-01-17 14:07:30 +08:00
} else {
el += `<span>${__(item.title)}</span>`
}
2024-01-17 00:27:48 +08:00
el += `</a>`
2022-10-22 13:03:47 +08:00
}
2024-01-17 00:27:48 +08:00
el += `</nav>`
return el
2022-10-22 13:03:47 +08:00
}
%>
<%- layoutDiv() %>