Skip to content

Commit

Permalink
Fix readthedocs#1522: fix attribute error if css is str
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Sep 28, 2023
1 parent 8ce23ce commit b22a77f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,19 @@
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- endif %}
{%- for css in css_files %}
{{ css_tag(css) }}
{% if css|attr("filename") -%}
{{ css_tag(css) }}
{%- else -%}
<link rel="stylesheet" href="{{ pathto(css, 1)|escape }}" type="text/css" />
{%- endif %}
{%- endfor %}

{%- for cssfile in extra_css_files %}
{{ css_tag(cssfile) }}
{% if css|attr("filename") -%}
{{ css_tag(css) }}
{%- else -%}
<link rel="stylesheet" href="{{ pathto(css, 1)|escape }}" type="text/css" />
{%- endif %}
{%- endfor -%}

{#- FAVICON
Expand Down

0 comments on commit b22a77f

Please sign in to comment.