|
28 | 28 | {%- endblock -%} |
29 | 29 |
|
30 | 30 | {#- CSS #} |
31 | | - {%- if sphinx_version_info < (4, 0) -%} |
32 | | - <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> |
33 | | - <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> |
34 | | - {%- endif %} |
35 | | - {%- if theme_analytics_id %} |
36 | | - <link rel="stylesheet" href="{{ pathto('_static/cookieconsent.css', 1) }}" type="text/css" /> |
37 | | - {%- endif %} |
38 | | - {%- for css in css_files %} |
39 | | - {%- if css|attr("rel") %} |
40 | | - <link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} /> |
| 31 | + {%- for css_file in css_files %} |
| 32 | + {%- if css_file|attr("filename") %} |
| 33 | + {{ css_tag(css_file) }} |
41 | 34 | {%- else %} |
42 | | - {%- if css.filename.startswith('https://') %} |
43 | | - <link rel="stylesheet" href="{{ css.filename }}" type="text/css" /> |
44 | | - {%- else %} |
45 | | - <link rel="stylesheet" href="{{ pathto(css.filename, 1) }}" type="text/css" /> |
46 | | - {%- endif %} |
| 35 | + <link rel="stylesheet" href="{{ pathto(css_file, 1)|escape }}" type="text/css" /> |
47 | 36 | {%- endif %} |
48 | 37 | {%- endfor %} |
49 | | - {%- for cssfile in extra_css_files %} |
50 | | - <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> |
| 38 | + |
| 39 | + {# |
| 40 | + "extra_css_files" is an undocumented Read the Docs theme specific option. |
| 41 | + There is no need to check for ``|attr("filename")`` here because it's always a string. |
| 42 | + Note that this option should be removed in favor of regular ``html_css_files``: |
| 43 | + https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_css_files |
| 44 | + #} |
| 45 | + {%- for css_file in extra_css_files %} |
| 46 | + <link rel="stylesheet" href="{{ pathto(css_file, 1)|escape }}" type="text/css" /> |
51 | 47 | {%- endfor -%} |
52 | 48 |
|
53 | 49 | {#- FAVICON #} |
|
0 commit comments