%
let proj = theme.wiki.projects[page.wiki];
function layoutToc() {
if (toc(page.content).length > 0) {
return toc(page.content, {
list_number: item.list_number,
min_depth: item.min_depth,
max_depth: item.max_depth
});
}
return '';
}
function layoutTocHeader(title) {
var el = '';
el += '
';
return el;
}
function layoutDocTree(pages) {
var el = '';
pages.forEach((p, i) => {
let isActive = '';
if (p.path === page.path) {
isActive += ' active';
}
el += '';
});
return el;
}
function layoutDiv(fallback) {
var type = '';
if (proj && proj.pages) {
if (proj.pages.length > 1) {
type = 'multi';
} else {
type = 'single';
}
} else {
let toc_content = toc(page.content);
if (toc_content && toc_content.length > 0) {
type = 'single';
}
}
var el = '';
if (type.length > 0) {
el += '';
} else if (item.fallback) {
el += partial(item.fallback, {item: theme.sidebar.widgets[item.fallback]});
}
return el;
}
%>
<%- layoutDiv() %>