Skip to content

Drop the table of contents from the landing page - #543

Draft
zieka wants to merge 1 commit into
masterfrom
fix/landing-page-toc
Draft

Drop the table of contents from the landing page#543
zieka wants to merge 1 commit into
masterfrom
fix/landing-page-toc

Conversation

@zieka

@zieka zieka commented Sep 2, 2026

Copy link
Copy Markdown
Member

Problem

  • The landing page (/) carries both navigation columns' worth of chrome for a page that needs neither, so the first thing a visitor sees is framing rather than content.
  • Its table of contents lists three headings — "How does OpenRewrite work?", "Get started", "Refactoring at scale with Moderne" — beside a page short enough to scan without one.
  • The sidebar was already detached there (Migrate onto the Moderne design system and rework the header #538), so the TOC is the only remaining column, and it sits alone against otherwise empty gutters.

Objectives

  1. Remove the table of contents from the landing page only.
  2. Keep the text at a readable measure once nothing else constrains it.
Assumptions
  • hide_table_of_contents is front matter on a single document, so the change cannot reach any other page. Confirmed: exactly one file in docs/ carries the flag.
  • It is the same native mechanism as the displayed_sidebar: null already on this document, so both columns are removed the same way rather than one natively and one in CSS.
  • 830px is not derivable from an existing variable. The 825px an article gets on a doc page is emergent from the flex layout (container minus sidebar minus TOC), not declared anywhere, so this is a new literal chosen to match it.
  • The landing page is the only page with neither navigation column, so the measure cap is scoped to html[data-route='/'] and affects nothing else.
Changes
  • (1) docs/introduction.md — adds hide_table_of_contents: true to the front matter, beside the existing displayed_sidebar: null.
  • (2) src/css/custom.css — caps article at 830px and centres it, under the existing html[data-route='/'] block.

No tests: this repo has no test framework or test files, and the change adds no testable logic. tsc and the production build are the available checks.

Notes
  • The measure cap is not cosmetic. Removing the TOC left the content column unconstrained and the prose ran to ~161 characters a line, roughly twice a readable measure. Measured after the fix: 104. Without this, the change would trade one problem for a worse one.
  • Scoped through data-route, published by src/theme/Root.tsx. Docusaurus's own docs-doc-id-* classes exist only in a production build, so styling one page through them renders differently under yarn start.
  • Verified: yarn typecheck clean; production build succeeds; TOC absent on / and present on every other page; article 830px, centred.

The entry point already shows no sidebar; the table of contents beside it
listed three headings on a page short enough to scan without one. Uses the
front matter flag, the same native mechanism as displayed_sidebar, so the
change is scoped to this one document and every other page keeps its TOC.

Caps the measure as a consequence. With neither navigation column, nothing
constrained the text and it ran to ~160 characters a line, roughly twice a
readable measure. 830px is what an article gets on an ordinary doc page, so
the landing page reads at the same rhythm as the pages it links to.
@zieka
zieka force-pushed the fix/landing-page-toc branch from 4d2d1e3 to 9ade44c Compare September 3, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant