diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html
index de89f0ba..87337a96 100644
--- a/sphinx_rtd_theme/layout.html
+++ b/sphinx_rtd_theme/layout.html
@@ -25,16 +25,6 @@
{# CSS #}
-
- {# RTD hosts this file themselves, only load for non RTD builds #}
- {% if not READTHEDOCS %}
-
- {% endif %}
-
- {% for cssfile in css_files %}
-
- {% endfor %}
-
{# JS #}
{% if not embedded %}
@@ -47,7 +37,7 @@
HAS_SOURCE: {{ has_source|lower }}
};
- {%- for scriptfile in script_files + ["_static/theme.js"] %}
+ {%- for scriptfile in script_files %}
{%- endfor %}
@@ -56,7 +46,17 @@
{% endif %}
{% endif %}
-
+
+ {# RTD hosts these file themselves, so just load on non RTD builds #}
+ {% if not READTHEDOCS %}
+
+
+ {% endif %}
+
+ {% for cssfile in css_files %}
+
+ {% endfor %}
+
{%- block linktags %}
{%- if hasdoc('about') %}