1. Configure the Integration
Add the table of contents integration to your astro.config.mjs
file:
import { defineConfig } from 'astro/config';
import { tableOfContents } from 'astro-table-of-contents';
export default defineConfig({
integrations: [
tableOfContents({
title: 'Table of Contents', // Custom title
}),
],
});