-
Notifications
You must be signed in to change notification settings - Fork 331
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
Links to static files defined in conf.py
are assigned incorrectly after build
#1328
Comments
I encountered the same issue recently - this is likely related to the discussion (involving @12rambau, who opened the issue) here: What confuses me most is why it is not possible to use the Sphinx
So to set my favicons I have:
Less potential for confusion about having paths relative to the config file etc. Is there a reason why this wasn't implemented for logo files also? |
As mentioned in the linked PR/issue, we decided to align on how Sphinx itself deals with |
Ok, fair enough - but then according to the documentation
if I have:
it should work? Because I am having trouble with that configuration:
|
@12rambau, I checked further: Irregardless of the path I use for the
the builder always ends up looking for the file at:
This file, however, won't ever exist - since Sphinx (as per the documentation) copies the subdirectories of the
In this case, this seems to be a bug with the theme, rather than a compatibility issue? |
FYI, the current workaround appears to be to place the logo images directly underneath a
and specify as follows in the html_static_path = ['_static']
html_theme_options = {
'logo': {
'image_light': '_static/logo_light.png',
'image_dark': '_static/logo_dark.png',
},
} |
Recently I posted an issue (#1325) about image icons with local paths not loading. I now found a similar problem with logo images, and think there is a general bug in generating links to static files that are defined in
conf.py
.Here is a simple setup to reproduce the problem with logos:
Docs directory structure:
conf.py
:index.rst
index.html
after buildThe logo in the header (defined in
conf.py
) is not loading, but the same file inserted as image inindex.rst
is displaying correctly:The image file
logo_dark.png
, which is inserted inindex.rst
is put underdocs/build/_images/logo_dark.png
and linked correctly in the HTML fileindex.html
. On the other hand, for the logo, the two images are put underdocs/build/_static/logo/logo_dark.png
anddocs/build/_static/logo/logo_light.png
, whereas the corresponding links in the HTML are pointing todocs/build/_static/logo_dark.png
anddocs/build/_static/logo_light.png
, and thus the images doesn't load.This problem also occurs when the static folder is named
_static
.The text was updated successfully, but these errors were encountered: