Commit 1562d19

HPCesia <me@hpcesia.com>
2025-02-13 13:06:02
fix: toc in no headings post
1 parent c85740f
Changed files (1)
src/layouts/PostPageLayout.astro
@@ -29,7 +29,7 @@ const { title, description, lang, headings, comment } = Astro.props;
     <slot name="aside-fixed" />
   </Fragment>
   <Fragment slot="aside-sticky">
-    {articleConfig.toc && headings && <TOC headings={headings} />}
+    {articleConfig.toc && headings && headings.length > 0 && <TOC headings={headings} />}
     <slot name="aside-sticky" />
   </Fragment>
 </MainLayout>