-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use .filename
attribute for CSS and JS files for pathto
#1503
Conversation
Sphinx 7.2 changed how it handles the CSS and JS files internally and they cannot be treated as string anymore. We need to access to their `.filename` attribute to get the same behavior. Closes #1502
@humitos I believe A |
|
@@ -32,12 +32,12 @@ | |||
{%- if css|attr("rel") %} | |||
<link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} /> | |||
{%- else %} | |||
<link rel="stylesheet" href="{{ pathto(css, 1) }}" type="text/css" /> | |||
<link rel="stylesheet" href="{{ pathto(css.filename, 1) }}" type="text/css" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI seems stuck, so I can't tell, but is this change compatible with Sphinx 5?
I wasn't aware of it. I understand you refer to this, right? I will give it a try. @agjohnson pinging you in case you know if there is a blocker about using these functions. |
If we are OK using sphinx_rtd_theme/sphinx_rtd_theme/layout.html Lines 31 to 41 in 2b1d3fa
|
Not off the top of my head. If there was a blocker, it would probably be projects with old/outdated configuration. |
It seems we already did something similar to this PR in the past: #1101. I think we should take a look at both and merge them into the final PR 😄 |
Sphinx 7.2 changed how it handles the CSS and JS files internally and they cannot be treated as string anymore. We need to access to their
.filename
attribute to get the same behavior.Closes #1502
Related #1463