shuding / nextra

Simple, powerful and flexible site generation framework with everything you love from Next.js.
https://nextra.site
MIT License
11.7k stars 1.27k forks source link

Headings in nested content not included in TOC #1540

Closed WCByrne closed 1 year ago

WCByrne commented 1 year ago

To better organize our project, I started breaking up pages in to smaller mdx files but I noticed that any headings are not rendered in the table of contents.

For example, in a page I might have:

import { UploadFile } from "../components/uploadFile.mdx";

# Creating Content

Create new content via out API...

<UploadFile />

If uploadFile.mdx contains headings, such as the following, they are not included in the TOC.

## Uploading a file

To upload a file do this...

Any workarounds for this?

dimaMachina commented 1 year ago

This is a known limitation, a similar issue to https://github.com/facebook/docusaurus/issues/3915

Unfortunately, there is no workaround at the moment

WCByrne commented 1 year ago

Copy that. Thanks.

dimaMachina commented 1 year ago

@WCByrne happy to say that I fixed this confusing behaviour!

image image image image
WCByrne commented 1 year ago

Great! Thank you.