From 4498e97b462688bac2ff3615ac1da1b867b21842 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Mon, 30 Oct 2023 21:41:11 +0300 Subject: [PATCH] Fix AttributeError when one of `css_files` is a string (#1537) Fix AttributeError when one of css_files is a string --- sphinx_rtd_theme/layout.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index bf2c52733..c8a307628 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -29,7 +29,11 @@ {%- endif %} {%- for css_file in css_files %} - {{ css_tag(css_file) }} + {%- if css_file|attr("filename") %} + {{ css_tag(css_file) }} + {%- else %} + + {%- endif %} {%- endfor %} {# "extra_css_files" is a theme option and it's always a string #}