Skip to content

Commit

Permalink
Update TOC to render correctly on type=page (#4111)
Browse files Browse the repository at this point in the history
* fix: update TOC rendering logic based on theme configuration and active type

* fix: simplify TOC rendering logic in ClientWrapper component

* Create cold-cycles-fix.md

---------

Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
  • Loading branch information
hichemfantar and dimaMachina authored Jan 30, 2025
1 parent 1ac8826 commit 5c51b49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cold-cycles-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nextra-theme-docs": patch
---

fix allow configuring `theme.toc` in `_meta` file when `toc.float` is set to `false` for pages with `type: 'page'`
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const ClientWrapper: MDXWrapper = ({
>
{themeContext.toc && (
<TOC
toc={themeConfig.toc.float ? toc : []}
toc={themeConfig.toc.float || activeType === 'page' ? toc : []}
filePath={metadata.filePath}
pageTitle={metadata.title}
/>
Expand Down

0 comments on commit 5c51b49

Please # to comment.