Skip to content

Inheriting themes should be able to set GitHub linksΒ #23

@dime10

Description

@dime10

Feature details

Right now, projects with doc pages that inherit from the PennyLane Sphynx theme have to either override the header and footer configs in order to set any GitHub links to their respective repository, or deal with links always pointing to the PennyLane repository.
The former is suboptimal because it would hardcode standard elements like the discussion forum link, and also ignore any temporary additions like a button to the current QHack event.

Ideally, the theme should consider the github_repo attribute in order to set any links accordingly.

Specifically, I'm talking about these navbar elements:
image

But the issue may apply to other things as well, like as these elements down here:
image
(But maybe we want to keep those hardcoded to PennyLane? πŸ€”)

Implementation

Something along the lines of:

github_repo = app.config["html_theme_options"].get("github_repo", None)

if github_repo is not None:
    NAVBAR_RIGHT[-1]["href"] = "https://github.com/" + github_repo

How important would you say this feature is?

1: Not important. Would be nice to have.

Additional information

No response

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