2021-07-04 20:21:31 +08:00
|
|
|
<%
|
|
|
|
function layoutDiv() {
|
|
|
|
var el = '';
|
2021-08-19 23:13:05 +08:00
|
|
|
el += '<div class="nav-wrap">';
|
2021-07-04 20:21:31 +08:00
|
|
|
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>';
|
|
|
|
// 项目分类
|
2021-07-26 22:26:46 +08:00
|
|
|
for (let id of Object.keys(theme.wiki.all_tags)) {
|
|
|
|
let tag = theme.wiki.all_tags[id];
|
|
|
|
let projects = tag.items.filter(function(item){
|
|
|
|
return item.index !== false;
|
2021-07-04 20:21:31 +08:00
|
|
|
})
|
|
|
|
if (projects && projects.length > 0) {
|
|
|
|
el += '<a';
|
2021-07-26 22:26:46 +08:00
|
|
|
if (tag.name && tag.name.length > 0 && page.tagName === tag.name) {
|
2021-07-04 20:21:31 +08:00
|
|
|
el += ' class="active"';
|
2021-02-20 13:09:41 +08:00
|
|
|
}
|
2021-07-26 22:26:46 +08:00
|
|
|
el += ' href="' + url_for(tag.path) + '">' + tag.name + '</a>';
|
2021-07-04 20:21:31 +08:00
|
|
|
el += '</a>';
|
2021-07-08 22:23:55 +08:00
|
|
|
}
|
2021-07-04 20:21:31 +08:00
|
|
|
}
|
|
|
|
el += '</nav>';
|
|
|
|
el += '</div>';
|
|
|
|
return el;
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
|
|
|
|
<%- layoutDiv() %>
|