Skip to content

Sidebar group headers should link to landing pages #405

Description

@miharp

Problem

Sidebar group headers render as plain, non-clickable text. Upstream Puppet docs (and VitePress generally) make a section header link to the section's landing page — for example, "The Puppet language" links to a language overview page.

The cause is in _includes/nav-item.html: when a nav entry has items:, the template renders the header and never checks link:, so a link: key on a group entry is silently ignored. The openbolt nav (_data/nav/openbolt_5x.yml) already declares link: on several group headers (Bolt, Plans, Tasks, Examples) and those links are dropped today.

Proposed fix (verified locally)

In the group branch of _includes/nav-item.html, render the header text as an anchor when link: is present, resolving the URL the same way the leaf-item branch does (absolute links starting with / pass through; others get the collection nav_base prefix).

This works with the theme as-is:

  • The collapse handler in the theme JS ignores clicks on anchors (event.target.closest('a')), so clicking the header navigates while the caret still toggles the section.
  • The theme CSS resets anchors to color: inherit; text-decoration: inherit;, so the header keeps its bold styling.

Verified with a local jekyll build: the header renders as a styled link and the openbolt group links resolve to existing pages.

First uses

  • Point "The Puppet language" group in _data/nav/openvox_8x.yml at lang_summary.html (our language overview page).
  • The openbolt group headers start linking automatically once the template honors link:.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions