Skip to content

Commit

Permalink
Fix AttributeError when one of css_files is a string (#1537)
Browse files Browse the repository at this point in the history
Fix AttributeError when one of css_files is a string
  • Loading branch information
mitya57 authored Oct 30, 2023
1 parent 84aea9b commit 4498e97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- endif %}
{%- for css_file in css_files %}
{{ css_tag(css_file) }}
{%- if css_file|attr("filename") %}
{{ css_tag(css_file) }}
{%- else %}
<link rel="stylesheet" href="{{ pathto(css_file, 1)|escape }}" type="text/css" />
{%- endif %}
{%- endfor %}

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

0 comments on commit 4498e97

Please sign in to comment.