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

Update globaltoc.html #7

Merged
merged 10 commits into from
Aug 29, 2022
Merged

Update globaltoc.html #7

merged 10 commits into from
Aug 29, 2022

Conversation

josh146
Copy link
Member

@josh146 josh146 commented Aug 28, 2022

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

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name and GitHub username in the contributors section.

Copy link
Collaborator

@Mandrenkov Mandrenkov left a 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

image

while the original Sphinx documentation looked similar to

image

{% if toc_overview %}
<p class="caption">{{ theme_project_nav_name or shorttitle }}</p>
<ul>
<li class="caption toctree-l1 {{'current' if pagename == 'index' }}">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! TIL about pagename. 🔥

xanadu_sphinx_theme/globaltoc.html Outdated Show resolved Hide resolved
@josh146
Copy link
Member Author

josh146 commented Aug 29, 2022

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.

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:

  1. index
  2. overview
  3. installation
  4. etc.

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 <Mandrenkov@users.noreply.github.com>
Copy link
Collaborator

@Mandrenkov Mandrenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in PennyLane-Qiskit! 🚀

image

@josh146 josh146 merged commit e016dfc into master Aug 29, 2022
@josh146 josh146 deleted the josh146-patch-1 branch August 29, 2022 21:25
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

Successfully merging this pull request may close these issues.

None yet

2 participants