Skip to content

Comments

Add dropdown menus to horizontal navbar and other updates#225

Merged
svekars merged 13 commits intopytorch_sphinx_theme2from
add-dropdown-support
Feb 11, 2026
Merged

Add dropdown menus to horizontal navbar and other updates#225
svekars merged 13 commits intopytorch_sphinx_theme2from
add-dropdown-support

Conversation

@svekars
Copy link
Contributor

@svekars svekars commented Feb 3, 2026

Adds dropdown menus to horizontal navbar items that have child pages. When hovering over these items on desktop, a dropdown displays (from the underlying toctree) the sub-pages for quick navigation.

  • Custom navbar-nav.html template that generates hierarchical navigation from toctree structure
  • Python functions in __init__.py to extract toctree children using toctree_includes
  • CSS styles in _navbar_dropdown.scss for hover-based dropdowns
  • Fix sd-cards mobile rendering
  • Add llm tags to the metadata
  • Added configuration-reference.md with all settings
  • Add function to generate llm.txt on build, can be disabled on conf.py

Features:

  • Desktop: Hover to show dropdown with child pages, click parent link to navigate
  • Mobile: Dropdowns hidden, parent link navigates to page directly
  • Scrollable dropdown for long lists (max-height: 70vh)
  • Respects header_links_before_dropdown config for "More" button
  • Pure CSS/Jinja implementation, no additional JavaScript
  • Enabled by default, can be disabled by setting html_theme_options: "enable_navbar_dropdowns": False

@netlify
Copy link

netlify bot commented Feb 3, 2026

Deploy Preview for pytorchsphinxtheme ready!

Name Link
🔨 Latest commit 43ae9d1
🔍 Latest deploy log https://app.netlify.com/projects/pytorchsphinxtheme/deploys/698cc7d0e1cff20008e0d5e6
😎 Deploy Preview https://deploy-preview-225--pytorchsphinxtheme.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.

@meta-cla meta-cla bot added the cla signed label Feb 3, 2026
@svekars svekars force-pushed the add-dropdown-support branch from 34a8679 to 0f16517 Compare February 4, 2026 21:40
@svekars svekars changed the title Adding PyTorch Sphinx theme 2 Add dropdown menus to horizontal navbar Feb 4, 2026
@svekars svekars changed the title Add dropdown menus to horizontal navbar Add dropdown menus to horizontal navbar and other updates Feb 6, 2026
@svekars svekars requested a review from sekyondaMeta February 6, 2026 22:30
@svekars svekars merged commit 2021e3b into pytorch_sphinx_theme2 Feb 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants