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

26 lines
609 B
Plaintext

<%
function layoutMainMenu() {
var el = '';
el += '<nav class="menu dis-select">'
for (let id of Object.keys(theme.sidebar.menu)) {
let item = theme.sidebar.menu[id];
if (item == undefined || item.length == 0) {
continue;
}
el += '<a class="nav-item';
if (id == page.menu_id) {
el += ' active';
}
el += '" href="' + url_for(md_link(item)) + '">';
el += __(md_text(item));
el += '</a>';
}
el += '</nav>';
return el;
}
%>
<header class='header<%- where == "main" ? " mobile-only" : "" %>'>
<%- partial('logo') %>
<%- layoutMainMenu() %>
</header>