diff --git a/layout/_partial/widgets/toc.ejs b/layout/_partial/widgets/toc.ejs index 63c4d7d..2ea11f2 100644 --- a/layout/_partial/widgets/toc.ejs +++ b/layout/_partial/widgets/toc.ejs @@ -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 += '
'; - }); + } } else { // 单 page if (proj.pages.length == 1) { el += layoutTocHeader(page.toc_title); diff --git a/source/css/_layout/md.styl b/source/css/_layout/md.styl index 9803a80..cfedefe 100644 --- a/source/css/_layout/md.styl +++ b/source/css/_layout/md.styl @@ -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