File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -233,15 +233,20 @@ def _remove_empty_templates(tname):
233
233
return True
234
234
235
235
context [section ] = list (filter (_remove_empty_templates , context [section ]))
236
-
236
+ #
237
237
# Remove a duplicate entry of the theme CSS. This is because it is in both:
238
238
# - theme.conf
239
239
# - manually linked in `webpack-macros.html`
240
240
if "css_files" in context :
241
241
theme_css_name = "_static/styles/pydata-sphinx-theme.css"
242
- if theme_css_name in context ["css_files" ]:
243
- context ["css_files" ].remove (theme_css_name )
244
-
242
+ for i in range (len (context ["css_files" ])):
243
+ asset = context ["css_files" ][i ]
244
+ # TODO: eventually the contents of context['css_files'] etc should probably
245
+ # only be _CascadingStyleSheet etc. For now, assume mixed with strings.
246
+ asset_path = getattr (asset , "filename" , str (asset ))
247
+ if asset_path == theme_css_name :
248
+ del context ["css_files" ][i ]
249
+ break
245
250
# Add links for favicons in the topbar
246
251
for favicon in context .get ("theme_favicons" , []):
247
252
icon_type = Path (favicon ["href" ]).suffix .strip ("." )
You can’t perform that action at this time.
0 commit comments