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

Canonical URLs wrong in dirhtml build #1675

Closed
kathatherine opened this issue Jan 22, 2024 · 2 comments · Fixed by #1699
Closed

Canonical URLs wrong in dirhtml build #1675

kathatherine opened this issue Jan 22, 2024 · 2 comments · Fixed by #1699

Comments

@kathatherine
Copy link

Hi all, I've just been made aware that the canonical URLs in one of my docsites are not matching the page URLs, which is causing issues with our SEO. Basically, the fact that these docs are created using the dirhtml build option means that the page URLs are ending in /, but the canonicals in the source HTML are showing as ending in index.html or .html, so that's the page type that Google is displaying in search, instead of the URL we want.

image

It's an upstream issue with Sphinx (sphinx-doc/sphinx#9730) that has been open for over two years now.

Some themes are choosing to fix the issue themselves (Furo - pradyunsg/furo#682, Sphinx awesome theme - kai687/sphinxawesome-theme#1262) and I was wondering if pydata-sphinx-theme might choose to do the same. Unfortunately, I can't find any workarounds documented that aren't at the theme level and this is outside my area of expertise as a technical writer, so I thought I would ask here. Thank you!

@drammock
Copy link
Collaborator

The fix in https://github.com/pradyunsg/furo/pull/727/files looks simple enough. Whoever gets around to copy-pasting it here: we should probably list @davidism as co-author on the commit.

@davidism
Copy link
Contributor

I've been exploring both Furo and Pydata as new base themes for Pallets projects, so I definitely wouldn't mind seeing my fix make it into here as well. A co-authored-by credit is a nice thought, thank you.

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 a pull request may close this issue.

3 participants