Skip to content

[Bug] Sidebar links go to different places than tile links #1065

@guberti

Description

@guberti

Issue

When sphinx-gallery generates a gallery of examples, you can navigate to examples by either clicking on the left-hand side menu or by clicking on the tiles in the gallery. Here's a screenshot of what that looks like on sphinx-gallery's own documentation.

image


You would expect both links to go to the same place, but this is not the case. The sidebar link for the "Plotting sin" example goes to:

https://sphinx-gallery.github.io/stable/auto_examples/plot_0_sin.html

while clicking on the tile takes you to:

https://sphinx-gallery.github.io/stable/auto_examples/plot_0_sin.html#sphx-glr-auto-examples-plot-0-sin-py

These deliver different user experiences - the former is what you'd expect, while the latter has the page scrolled down to the title. This means that users who click the latter link are unable to see sphinx-gallery's note about downloading example code or running in Binder.

image


Solution

I'd like to change the tile link so that both go to:

https://sphinx-gallery.github.io/stable/auto_examples/plot_0_sin.html

This should only require modifying sphinx_gallery/backreferences.py, but I'd like @larsoner to first confirm that this is a bug and not intended behavior before I make a PR.

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