2021-07-04 20:21:31 +08:00
|
|
|
<%
|
|
|
|
function layoutDiv() {
|
|
|
|
var el = '';
|
|
|
|
el += '<div class="nav-wrap mobile-hidden">';
|
|
|
|
el += '<nav class="sub wiki cap">';
|
|
|
|
// 所有项目
|
|
|
|
el += '<a';
|
|
|
|
if (page.filter === false) {
|
|
|
|
el += ' class="active"';
|
|
|
|
}
|
|
|
|
el += ' href="' + url_for(config.wiki_dir || "/wiki/") + '">' + __("btn.all_wiki") + '</a>';
|
|
|
|
el += '</a>';
|
|
|
|
// 项目分类
|
|
|
|
for (let group_name of Object.keys(theme.wiki.groups)) {
|
|
|
|
let group = theme.wiki.groups[group_name];
|
|
|
|
let projects = group.projects.filter(function(proj){
|
|
|
|
return proj.index !== false;
|
|
|
|
})
|
|
|
|
if (projects && projects.length > 0) {
|
|
|
|
el += '<a';
|
|
|
|
if (group.title && group.title.length > 0 && page.group === group.title) {
|
|
|
|
el += ' class="active"';
|
2021-02-20 13:09:41 +08:00
|
|
|
}
|
2021-07-04 20:21:31 +08:00
|
|
|
el += ' href="' + url_for(group.path) + '">' + group.title + '</a>';
|
|
|
|
el += '</a>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
el += '</nav>';
|
|
|
|
el += '</div>';
|
|
|
|
return el;
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
|
|
|
|
<%- layoutDiv() %>
|