-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update globaltoc.html #7
Conversation
Hello. You may have forgotten to update the changelog!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @josh146, thanks for the update! Overall, it looks pretty solid. 🗻
Do you have any screenshots of how the new global ToC looks like? I remember encountering this issue with PennyLane Lightning and settling on an approach where we move the majority of the contents from index.rst
into a separate file named overview.rst
and linking accordingly.
The result looks like
while the original Sphinx documentation looked similar to
{% if toc_overview %} | ||
<p class="caption">{{ theme_project_nav_name or shorttitle }}</p> | ||
<ul> | ||
<li class="caption toctree-l1 {{'current' if pagename == 'index' }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! TIL about pagename
. 🔥
I actually tried this (using the same structure as lightning), but discovered a really annoying edge case. When navigating the docs by clicking 'Next', you go:
so you end up seeing the same content twice! And separately I realized this might also have SEO implications (Google penalizes content repeated on different URLs) |
Co-authored-by: Mikhail Andrenkov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context: The PL plugins had a customized version of the theme which allowed the plugin name (and a link to
index.rst
) to be included in the global TOC.Description of the Change: Modifies the global TOC to include the project title in the sidebar
Benefits: As above.
Possible Drawbacks: n/a
Related GitHub Issues: n/a