Skip to content

Commit

Permalink
Added html_css_files configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Zulko committed Oct 1, 2019
1 parent 6c4da53 commit 1984cdd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ See docs on `html_sidebars <http://www.sphinx-doc.org/en/master/usage/configurat
html_sidebars = {'**': ['util/searchbox.html', 'util/sidetoc.html']}
html_css_files
^^^^^^^^^^^^^^

Adds custom CSS files to the theme:

.. code-block:: python
html_css_files = ["css/custom.css"]
templates
=========
Expand Down
7 changes: 7 additions & 0 deletions sphinx_press_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
{%- block css %}
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1)}}">
<link rel="stylesheet" href="{{ pathto('_static/theme.css', 1)}}">
{%- 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 %}
{%- endblock %}

{%- block scripts %}
Expand Down

0 comments on commit 1984cdd

Please sign in to comment.