2021-02-21 03:13:21 +08:00
|
|
|
<%
|
|
|
|
function layoutMainMenu() {
|
|
|
|
var el = '';
|
|
|
|
el += '<nav class="menu">'
|
|
|
|
for (let id of Object.keys(theme.sidebar.menu)) {
|
|
|
|
let item = theme.sidebar.menu[id];
|
2021-02-22 13:37:58 +08:00
|
|
|
if (item.url == undefined || item.url.length == 0) {
|
|
|
|
continue;
|
|
|
|
}
|
2021-02-21 03:13:21 +08:00
|
|
|
el += '<a class="nav-item';
|
|
|
|
if (id == page.menu_id) {
|
|
|
|
el += ' active';
|
|
|
|
}
|
|
|
|
el += '" href="' + url_for(item.url) + '">';
|
2021-02-22 23:07:12 +08:00
|
|
|
el += __(item.title);
|
2021-02-21 03:13:21 +08:00
|
|
|
el += '</a>';
|
|
|
|
}
|
|
|
|
el += '</nav>';
|
|
|
|
return el;
|
|
|
|
}
|
|
|
|
%>
|
2021-02-19 23:33:19 +08:00
|
|
|
<header class='header'>
|
|
|
|
<%- partial('logo') %>
|
2021-02-21 03:13:21 +08:00
|
|
|
<%- layoutMainMenu() %>
|
|
|
|
</header>
|