Skip to content

Commit

Permalink
Fix #1522: fix 'str' object has no attribute 'attributes' (#1528)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Oct 24, 2023
1 parent 8ce23ce commit 32310a8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- endif %}
{%- for css in css_files %}
{{ css_tag(css) }}
{%- for css_file in css_files %}
{{ css_tag(css_file) }}
{%- endfor %}

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

{#- FAVICON
Expand Down

0 comments on commit 32310a8

Please sign in to comment.