Skip to content

Extend the navbar via parts configuration (similar to the sidebar and footer) #801

@choldgraf

Description

@choldgraf

We allow users to extend the primary sidebar, as well as the footer, by defining markdown as a "part" and teaching the theme to look for that part and add it to the relevant UI space accordingly. In order to allow users to add extensibility to the navbar (e.g., icons or badges) we could add follow the same pattern.

Proposal

If the user configures a navbar_right part, it will be parsed as AST and inserted just after the theme light/dark button (the right-most part of the screen).

A user configures the part like so:

site:
  parts:
    navbar_right: icon-links.md  # Or in-line markdown

And in the file:

# in icon-links.md
![](markdown-badge.svc) | {button}`CTA`

And that file will be parsed and inserted here:

Image

Implementation

This would basically follow exactly what we do with footers and primary sidebar.

Considerations

  • This would let users extend different UI parts of their site via the same structure we've already started using for footers etc.
  • Plugins that define new roles and directives (or PRs like Add scienceicon renderers #752 ) could be used in these spaces without needing new configuration etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions