Skip to content

Commit b22a77f

Browse files
committed
Fix readthedocs#1522: fix attribute error if css is str
1 parent 8ce23ce commit b22a77f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sphinx_rtd_theme/layout.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,19 @@
2929
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
3030
{%- endif %}
3131
{%- for css in css_files %}
32-
{{ css_tag(css) }}
32+
{% if css|attr("filename") -%}
33+
{{ css_tag(css) }}
34+
{%- else -%}
35+
<link rel="stylesheet" href="{{ pathto(css, 1)|escape }}" type="text/css" />
36+
{%- endif %}
3337
{%- endfor %}
3438

3539
{%- for cssfile in extra_css_files %}
36-
{{ css_tag(cssfile) }}
40+
{% if css|attr("filename") -%}
41+
{{ css_tag(css) }}
42+
{%- else -%}
43+
<link rel="stylesheet" href="{{ pathto(css, 1)|escape }}" type="text/css" />
44+
{%- endif %}
3745
{%- endfor -%}
3846

3947
{#- FAVICON

0 commit comments

Comments
 (0)