Skip to content

Commit 32310a8

Browse files
leplatremhumitosagjohnson
authored
Fix #1522: fix 'str' object has no attribute 'attributes' (#1528)
* Fix #1522: fix attribute error if css is str * Revert "Fix #1522: fix attribute error if css is str" This reverts commit b22a77f. * Use `css_tag` only for standard CSS files from Sphinx ... and keep using the custom `link` HTML tag for CSS files included via the HTML theme option `extra_css_files`. * Normalize template variables --------- Co-authored-by: Manuel Kaufmann <[email protected]> Co-authored-by: Anthony Johnson <[email protected]>
1 parent 8ce23ce commit 32310a8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sphinx_rtd_theme/layout.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
2929
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
3030
{%- endif %}
31-
{%- for css in css_files %}
32-
{{ css_tag(css) }}
31+
{%- for css_file in css_files %}
32+
{{ css_tag(css_file) }}
3333
{%- endfor %}
3434

35-
{%- for cssfile in extra_css_files %}
36-
{{ css_tag(cssfile) }}
35+
{# "extra_css_files" is a theme option and it's always a string #}
36+
{%- for css_file in extra_css_files %}
37+
<link rel="stylesheet" href="{{ pathto(css_file, 1)|escape }}" type="text/css" />
3738
{%- endfor -%}
3839

3940
{#- FAVICON

0 commit comments

Comments
 (0)