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

26 lines
554 B
Plaintext

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