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
Fix support for html logo and favicon as url #9381
Conversation
Stripping the url in the context setup means that any later isurl() calls will fail and logo_url will always be a local relative path.
Could you merge the HEAD of 4.x branch please? |
Will do. I've pushed the merge as well as the assignment fixes. I need a bit more time for the test :) |
Thank you for update. Merging now! |
Hello @tk0miya and @tronical -- I believe this fix has a problem. I will try to state it as I understand the situation. If you pull your The configuration documentation for the HTML writer makes it clear that During building both these files will be copied over into the output into the
That is, in my configuration directory, I have a However, now the problem comes with setting the values for However, now that we're no longer only taking the basename, the writer is expecting the file to account for the entire input file path to the logo file even though it doesn't write that full path into the output during building. That is:
I'm really not sure how to fix this problem. There is a workaround -- if you put the logo (and favicon) in your file path in the same directory as the conf file, then there's no preceding relative path in the input declaration of I'm quite sorry for the length of this explanation and for commenting on a closed PR. @tk0miya --- please, what would you like me to do as a next step? Should I take this comment and turn it into a regression issue? |
Great problem description. Sounds like a valid use-case and therefore regression to me. I could make a change that applies basename again if the supplied values are not URLs. What do you think? |
I think that might do. The documentation for the Templating says this:
This seems to indicate to me that we expect I suspect, therefore, that you're correct that base naming would work when building the values to passed down to the templating engine -- the writer output expects the simple "logo" file location to be relative to the output static directory when it's building either the path value, or the URL value. |
@tronical @ViktorHaag, could this be the cause of the missing logo in our recent builds over at SciPy? We did not change anything to the config and have |
@tupui I suspect it might. From what I can tell, if you set |
Just checked and this is the case! Thanks for your help. So I can also confirm the regression here. |
As we have a replication from SciPy, I've created an issue for going forward: #9438 |
refer to sphinx-doc/sphinx#9381 Signed-off-by: taleintervenor <taleintervenor@sjtu.edu.cn>
… conf.py Merge request sphinx-doc#9381 broke support for local logos/favicons as it retained the paths that are passed to the template engine. That's wrong as the actual path will be in _static/. This should fix sphinx-doc#9438
… conf.py Merge request sphinx-doc#9381 broke support for local logos/favicons as it retained the paths that are passed to the template engine. That's wrong as the actual path will be in _static/. This should fix sphinx-doc#9438
Subject: Fix support for html logo and favicon as url
Feature or Bugfix
Purpose
Stripping the url in the context setup means that any later isurl()
calls will fail and logo_url will always be a local relative path.