[opt] toc
This commit is contained in:
parent
6b7a6a2048
commit
48c9119701
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue