diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html
index 9100b150..48b64f59 100644
--- a/sphinx_rtd_theme/layout.html
+++ b/sphinx_rtd_theme/layout.html
@@ -25,41 +25,17 @@
{# CSS #}
- {# JS #}
+ {# OPENSEARCH #}
{% if not embedded %}
-
-
- {%- for scriptfile in script_files %}
-
- {%- endfor %}
-
{% if use_opensearch %}
{% endif %}
{% endif %}
- {# RTD hosts these file themselves, so just load on non RTD builds #}
+ {# RTD hosts this file, so just load on non RTD builds #}
{% if not READTHEDOCS %}
-
- {% endif %}
-
- {# STICKY NAVIGATION #}
- {% if theme_sticky_navigation %}
-
{% endif %}
{% for cssfile in css_files %}
@@ -94,6 +70,7 @@
{%- endblock %}
{%- block extrahead %} {% endblock %}
+ {# Keep modernizr in head - http://modernizr.com/docs/#installing #}
@@ -145,5 +122,39 @@
{% include "versions.html" %}
+
+ {% if not embedded %}
+
+
+ {%- for scriptfile in script_files %}
+
+ {%- endfor %}
+
+ {% endif %}
+
+ {# RTD hosts this file, so just load on non RTD builds #}
+ {% if not READTHEDOCS %}
+
+ {% endif %}
+
+ {# STICKY NAVIGATION #}
+ {% if theme_sticky_navigation %}
+
+ {% endif %}
+
+ {%- block footer %} {% endblock %}
+