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

set html_tag block is missing data-content_root (sphinx 7.2+ basic theme change) #1498

Closed
kay-kim opened this issue Oct 6, 2023 · 3 comments · Fixed by #1559
Closed

set html_tag block is missing data-content_root (sphinx 7.2+ basic theme change) #1498

kay-kim opened this issue Oct 6, 2023 · 3 comments · Fixed by #1559

Comments

@kay-kim
Copy link

kay-kim commented Oct 6, 2023

Sphinx basic theme seems to now use data-content_root instead of DOCUMENTATION_OPTIONS.URL_ROOT which is set in the html element.
See sphinx-doc/sphinx@8e730ae for the change.

As such, the sphinx 7.2+ search results for dirhtml builds have resulting urls that have search/undefined in them (which makes them 404 when a user clicks on the resulting links.

Maybe modifying https://github.com/pydata/pydata-sphinx-theme/blob/185a37aa36820f77bffa4c87a772092e9e7cc380/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html#L4C1-L6C13 to include data-content_root="../" might fix it?

@12rambau
Copy link
Collaborator

12rambau commented Oct 19, 2023

Do you have an example of such a behavior in our own doc (now finally building with Sphinx 7)? I fail to clearly understand what search result you are talking about and I want to make sure that such a modification is not going to impact older version of Sphinx (that we need to continue supporting).

@kay-kim
Copy link
Author

kay-kim commented Oct 20, 2023

So, I have an example on a locally built pydata-sphinx-theme docs (I pointed to where the link url has search/undefined -- all the results have that search/undefined in their urls)

Screenshot 2023-10-19 at 9 41 07 PM

As mentioned, this behavior happens for for dirhtml builds, so I did update noxfile.py to build dirhtml instead of html
Screenshot 2023-10-19 at 9 43 14 PM

@vkbo
Copy link
Contributor

vkbo commented Nov 11, 2023

I'm encountering this issue as well. See: https://novelwriter.io/search.html?q=tags#

Here's the console log:
image

Edit: I downgraded Sphinx to 6.2.1 for now on my website, so it no longer produces this error.

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