Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inheriting themes should be able to set GitHub links #23

Open
dime10 opened this issue Mar 8, 2023 · 0 comments
Open

Inheriting themes should be able to set GitHub links #23

dime10 opened this issue Mar 8, 2023 · 0 comments

Comments

@dime10
Copy link

dime10 commented Mar 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant