Skip to content

fix(toc): hide the table of contents in print - #2297

Merged
markdumay merged 1 commit into
mainfrom
fix/toc-print
Oct 31, 2026
Merged

markdumay merged 1 commit into
mainfrom
fix/toc-print

Conversation

@markdumay

Copy link
Copy Markdown
Collaborator

On paper the table of contents is noise: its links go nowhere, and the show-more button cuts the list short with a control nobody can press.

This adds Bootstrap's d-print-none to the sidebar heading and list in assets/toc-parse-content.html, and to the button and panel in assets/toc-dropdown.html. The classes sit in the partials, not in toc.html or header.html, so a site that shadows those layouts inherits the change.

The screen rendering is unchanged. The toc.html wrapper stays in print, as it can also hold the download button.

Evidence:

  • pnpm build:example builds clean, and pnpm lint passes.
  • The example site's HTML carries the class on the sidebar heading and list and on the dropdown button.
  • The compiled main stylesheet keeps @media print{.d-print-none{display:none!important}} after PurgeCSS.
  • Not tested: an actual print from a browser.

🤖 Generated with Claude Code

On paper the links go nowhere and the show-more button cuts the list
short. Hide the sidebar list and the small-screen dropdown in print.
Both partials carry the class, so a site that shadows toc.html or
header.html inherits it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit bad5c27
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6ae602b177741e7c6fb2292c
😎 Deploy Preview https://deploy-preview-2297--gethinode-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@markdumay
markdumay merged commit b8be3bd into main Oct 31, 2026
17 checks passed
@markdumay
markdumay deleted the fix/toc-print branch October 31, 2026 16:02
@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 3.48.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant