Skip to content

Commit

Permalink
Allow setting 'rel' and 'title' attributes for stylesheets (#551)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blendify committed Jan 18, 2018
1 parent 6f5d0d9 commit c0b494e
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,20 @@
{% endif %}

{# RTD hosts this file, so just load on non RTD builds #}
{% if not READTHEDOCS %}
{%- if not READTHEDOCS %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
{% endif %}

{%- endif %}
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />

{% for cssfile in css_files %}
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
{% endfor %}

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

{%- block linktags %}
{%- if hasdoc('about') %}
Expand Down

0 comments on commit c0b494e

Please sign in to comment.