Skip to content

Commit 4498e97

Browse files
authored
Fix AttributeError when one of css_files is a string (#1537)
Fix AttributeError when one of css_files is a string
1 parent 84aea9b commit 4498e97

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sphinx_rtd_theme/layout.html

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

3539
{# "extra_css_files" is a theme option and it's always a string #}

0 commit comments

Comments
 (0)