[opt] toc
This commit is contained in:
parent
6b7a6a2048
commit
48c9119701
|
@ -78,14 +78,17 @@ function layoutDiv(fallback) {
|
||||||
} else if (proj) {
|
} else if (proj) {
|
||||||
// wiki 布局
|
// wiki 布局
|
||||||
if (proj.sections && proj.sections.length > 0 && proj.pages.length > 1) { // 多 pages
|
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) {
|
if (sec.title?.length > 0) {
|
||||||
el += layoutTocHeader(sec.title);
|
el += layoutTocHeader(sec.title);
|
||||||
}
|
}
|
||||||
el += '<div class="widget-body fs14">';
|
el += '<div class="widget-body fs14">';
|
||||||
el += layoutDocTree(sec.pages);
|
el += layoutDocTree(sec.pages);
|
||||||
el += '</div>';
|
el += '</div>';
|
||||||
});
|
}
|
||||||
} else { // 单 page
|
} else { // 单 page
|
||||||
if (proj.pages.length == 1) {
|
if (proj.pages.length == 1) {
|
||||||
el += layoutTocHeader(page.toc_title);
|
el += layoutTocHeader(page.toc_title);
|
||||||
|
|
|
@ -35,7 +35,7 @@ h1.article-title
|
||||||
>:first-child:not(h1)
|
>:first-child:not(h1)
|
||||||
margin-top: 0
|
margin-top: 0
|
||||||
h1:not(:first-child)
|
h1:not(:first-child)
|
||||||
margin-top: 2em
|
margin-top: 1em
|
||||||
h2
|
h2
|
||||||
margin-bottom: 1rem
|
margin-bottom: 1rem
|
||||||
h3,h4,h5,h6
|
h3,h4,h5,h6
|
||||||
|
|
Loading…
Reference in New Issue