[opt] wiki toc

This commit is contained in:
xaoxuu 2022-11-19 23:03:52 +08:00
parent ea97f0f6cd
commit 977d3264b8
2 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,7 @@ function layoutDocTree(pages) {
el += '<div class="doc-tree' + isActive + '">';
if (proj.pages.length > 1) {
let href = url_for(p.path);
if (i == 0) {
if (p.is_homepage) {
href += '#start'
}
el += '<a class="doc-tree-link' + isActive + '" href="' + href + '">';

View File

@ -95,6 +95,7 @@ module.exports = ctx => {
continue
}
proj.homepage = proj_pages[0]
proj.homepage.is_homepage = true
// 内页按 section 分组
var section_configs = []
if (proj.sections) {