2021-06-26 15:02:32 +08:00
|
|
|
<%
|
|
|
|
function layoutDiv() {
|
|
|
|
if (page.layout !== "wiki") {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
var el = '';
|
2021-07-04 20:21:31 +08:00
|
|
|
let proj = theme.wiki.projects[page.wiki];
|
|
|
|
if (proj.group && proj.group.length > 0) {
|
|
|
|
let group = theme.wiki.groups[proj.group];
|
|
|
|
let projects = group.projects.filter(function(proj){
|
|
|
|
return proj.index !== false;
|
|
|
|
})
|
|
|
|
if (projects && projects.length > 1) {
|
|
|
|
var el = '';
|
|
|
|
el += '<div class="widget-wrap" id="related">';
|
|
|
|
el += '<div class="widget-header cap dis-select">';
|
|
|
|
el += '<span class="name">更多' + group.title + '</span>';
|
|
|
|
el += '</div>';
|
|
|
|
el += '<div class="widget-body fs14">';
|
|
|
|
projects.forEach((p, i) => {
|
|
|
|
if (p.title !== proj.title) {
|
|
|
|
// 同一个分组中的其它项目
|
2021-07-13 22:25:24 +08:00
|
|
|
el += '<a class="more-item wiki" href="' + url_for(p.path) + '">';
|
2021-07-04 20:21:31 +08:00
|
|
|
el += p.title;
|
|
|
|
el += '<div class="excerpt">';
|
|
|
|
el += p.description;
|
|
|
|
el += '</div>';
|
|
|
|
el += '</a>';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
el += '</div>';
|
|
|
|
el += '</div>';
|
|
|
|
}
|
|
|
|
}
|
2021-06-26 15:02:32 +08:00
|
|
|
return el;
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
<%- layoutDiv() %>
|