[opt] toc

This commit is contained in:
xaoxuu 2023-12-20 12:17:35 +08:00
parent 6b7a6a2048
commit 48c9119701
2 changed files with 6 additions and 3 deletions

View File

@ -78,14 +78,17 @@ function layoutDiv(fallback) {
} else if (proj) {
// wiki 布局
if (proj.sections && proj.sections.length > 0 && proj.pages.length > 1) { // 多 pages
proj.sections.forEach((sec, i) => {
for (let sec of proj.sections) {
if (sec.pages.length == 0) {
continue;
}
if (sec.title?.length > 0) {
el += layoutTocHeader(sec.title);
}
el += '<div class="widget-body fs14">';
el += layoutDocTree(sec.pages);
el += '</div>';
});
}
} else { // 单 page
if (proj.pages.length == 1) {
el += layoutTocHeader(page.toc_title);

View File

@ -35,7 +35,7 @@ h1.article-title
>:first-child:not(h1)
margin-top: 0
h1:not(:first-child)
margin-top: 2em
margin-top: 1em
h2
margin-bottom: 1rem
h3,h4,h5,h6