nuxt-x-blog
TableOfContents
Auto-generated table of contents for blog post pages.
TableOfContents
The XBLTableOfContents component renders a sticky sidebar navigation list built from the heading structure of the current post. Controlled by the showTableOfContents flag in xBlog app config.
Components
<XBLTableOfContents />
Pass the body of the post returned by Nuxt Content. The component extracts headings and highlights the active section as the user scrolls.
<XBLTableOfContents :post="post" />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
post | BlogPost | required | Full post object including parsed body from Nuxt Content |
title | string | 'On This Page' | Section heading above the TOC list |
maxDepth | number | 3 | Maximum heading depth to include (h2 = 2, h3 = 3, etc.) |
AI Context
component: XBLTableOfContents
package: "@xenterprises/nuxt-x-blog"
use-when: Sticky sidebar navigation for headings on a blog post page
