Skip to content

Improve sidebar navigation #18

Description

@rathermercurial

Goal

Improve the sidebar navigation.

Requirements

  • Add and configure an appropriate multi-section sidebar plugin for Starlight.
    • This should affect only the default Starlight src/content/docs content, not other collections or ad-hoc pages displayed elsewhere (see below).
  • Segment docs by top-level folder with a nav selector.
  • Improve sidebar entry styling and default open state.
  • Add links to non-docs collections — either offboard the nav switcher to the bottom of the sidebar with an hr border (preferred), or in the header (backup).

Recommended approach

The requirements map cleanly onto an existing, well-maintained plugin rather than a custom build:

  • starlight-sidebar-topics (by HiDeoo — same author as the starlight-auto-sidebar already in use, so they compose). Splits docs into "topics", each with its own sidebar, and renders a topic selector above the sidebar links. A topic can also be a plain link (e.g. out to a non-docs collection page) — covering the "links to non-docs collections" requirement directly.
  • Want a dropdown switcher specifically? starlight-sidebar-topics-dropdown is the variant.
  • Lighter alternative: Starlight Utils → Multi-Sidebar.

Implementation notes / caveats

  • "Segment docs by top-level folder" = one topic per top-level dir (About / Solidarity Primitives / Bread Cooperative). The plugin needs each doc assigned to a topic — this interacts with the current autogenerate sidebar in astro.config.mjs; expect to migrate the sidebar: config and set a topic per page (frontmatter or config).
  • "Improve entry styling & default open state" is split across: the plugin, _meta.yml collapsed (via starlight-auto-sidebar), and CSS in global.css. The built-in sidebar guide covers collapsed, badge, and groups.
  • "Nav switcher at the bottom of the sidebar with an hr" (the preferred option) likely needs a small Sidebar component override in src/overrides/SiteTitle is already overridden, so the pattern exists. See overriding components.

References

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions