<% const proj = theme.wiki.tree[page.wiki] function layoutTocHeader(title) { var el = '' el += `
` el += `${title || __("meta.toc")}` el += `
` return el } function layoutDocTree(pages) { var el = '' for (let p of pages) { if (p.title == null || p.title.length == 0) { continue } let isActive = '' if (p.path === page.path) { isActive += ' active' } if (proj.pages.length > 1) { let href = url_for(p.path); if (p.is_homepage) { href += '#start' } el += `` el += `${p.title}` if (isActive.length > 0) { el += icon('default:bookmark.active') } el += `` } } return el } function layoutDiv(fallback) { if (proj == null) { return '' } if (proj.pages == null || proj.pages.length == 0) { return '' } if (proj.sections == null || proj.sections.length == 0) { return '' } var el = '' for (let sec of proj.sections) { if (sec.pages.length == 0) { continue } if (sec.title?.length > 0) { el += layoutTocHeader(sec.title) } const docTree = layoutDocTree(sec.pages) if (docTree.trim().length > 0) { el += `
${docTree}
` } } if (el.trim().length > 0) { return `${el}` } else { return '' } } %> <%- layoutDiv() %>