-
Notifications
You must be signed in to change notification settings - Fork 0
Define global table of contents settings for consistent sidebar headings #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add tableOfContents config to themeConfig - Set minHeadingLevel: 2, maxHeadingLevel: 3 - Ensures consistent H2 and H3 display across all pages - Fixes inconsistent TOC rendering from Notion-generated content This global configuration ensures that: - All H2 headings appear in right sidebar TOC - All H3 headings appear nested under H2 - Behavior is consistent regardless of content source - No per-page frontmatter configuration needed The TOC inconsistency was likely caused by: - Missing global configuration (Docusaurus defaults not explicit) - Notion-generated markdown with varying structure - Potential heading syntax issues in generated content Fixes #39
🚀 Preview DeploymentYour documentation preview is ready! Preview URL: https://pr-44.comapeo-docs.pages.dev This preview will update automatically when you push new commits to this PR. Built with commit a4f4af0 |
Code Review SummaryWhat This PR DoesThis PR fixes inconsistent table of contents (TOC) rendering in the documentation sidebar by:
How It Solves the IssueBy explicitly configuring
Potential Issues & ConsiderationsStrengths:
Areas to Watch:
Code Quality:
Testing:
Recommendation: ✅ Approve - Simple, well-targeted fix for a configuration issue. The explicit TOC settings will ensure consistent sidebar rendering across the site. |
… TOC - Add fixHeadingHierarchy() function to normalize Notion exports - Converts multiple H1s to H1/H2 structure for proper TOC generation - Removes empty headings that cause rendering issues - Comprehensive test suite with 8 new test cases (22 tests total, all passing) - Integrates seamlessly with existing content sanitization pipeline Complements docusaurus.config.ts TOC configuration to fix: #39
These files should not be tracked as they're in ignored directories and don't serve any purpose in this branch. Related to: PR #59
🧹 Preview Deployment CleanupThe preview deployment for this PR has been cleaned up. Preview URL was: Note: Cloudflare Pages deployments follow automatic retention policies. Old previews are cleaned up automatically. |
Background
Documentation pages rendered from Notion show inconsistent entries in the right sidebar table of contents. Some level 2 and level 3 headings appear while others are missing.
Findings
docusaurus.config.tscurrently relies on the Docusaurus defaults and does not populatethemeConfig.tableOfContents.worktrees/fix-toc-inconsistency/docusaurus.config.ts) demonstrates that settingtableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 3 }yields consistent results.Goal
Define global table of contents settings so that every heading at level 2 and level 3 appears in the sidebar across the site.
Acceptance Criteria
themeConfig.tableOfContentsis declared indocusaurus.config.tswithminHeadingLevel: 2andmaxHeadingLevel: 3.Testing
bunx prettier --write docusaurus.config.ts