mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2026-10-15 02:42:01 -05:00
Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e276b9ca5d | ||
|
|
271c3a9b70 | ||
|
|
5e734b4424 | ||
|
|
62069146e3 | ||
|
|
d2cd909f6b | ||
|
|
5d10a1f2fb | ||
|
|
966d5e4ba7 | ||
|
|
0aae6ce01a | ||
|
|
8d6ce57c87 | ||
|
|
c8a20f3e08 |
No files matched your search
+9
-9
@@ -85,21 +85,21 @@ module.exports = function(grunt) {
|
||||
options: {
|
||||
external: ['jquery'],
|
||||
alias: {
|
||||
'sphinx-rtd-theme': './js/theme.js'
|
||||
'sphinx-rtd-theme': './js/theme.js_t'
|
||||
}
|
||||
},
|
||||
src: ['js/*.js'],
|
||||
dest: 'sphinx_rtd_theme/static/js/theme.js'
|
||||
src: ['js/*.js_t'],
|
||||
dest: 'sphinx_rtd_theme/static/js/theme.js_t'
|
||||
},
|
||||
build: {
|
||||
options: {
|
||||
external: ['jquery'],
|
||||
alias: {
|
||||
'sphinx-rtd-theme': './js/theme.js'
|
||||
'sphinx-rtd-theme': './js/theme.js_t'
|
||||
}
|
||||
},
|
||||
src: ['js/*.js'],
|
||||
dest: 'sphinx_rtd_theme/static/js/theme.js'
|
||||
src: ['js/*.js_t'],
|
||||
dest: 'sphinx_rtd_theme/static/js/theme.js_t'
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
@@ -113,7 +113,7 @@ module.exports = function(grunt) {
|
||||
},
|
||||
files: [{
|
||||
expand: true,
|
||||
src: ['sphinx_rtd_theme/static/js/*.js', '!sphinx_rtd_theme/static/js/*.min.js'],
|
||||
src: ['sphinx_rtd_theme/static/js/*.js_t', '!sphinx_rtd_theme/static/js/*.min.js_t'],
|
||||
dest: 'sphinx_rtd_theme/static/js/',
|
||||
rename: function (dst, src) {
|
||||
// Use unminified file name for minified file
|
||||
@@ -131,7 +131,7 @@ module.exports = function(grunt) {
|
||||
linebreak: true
|
||||
},
|
||||
files: {
|
||||
src: [ 'sphinx_rtd_theme/static/js/theme.js', 'sphinx_rtd_theme/static/css/theme.css' ]
|
||||
src: [ 'sphinx_rtd_theme/static/js/theme.js_t', 'sphinx_rtd_theme/static/css/theme.css' ]
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -163,7 +163,7 @@ module.exports = function(grunt) {
|
||||
},
|
||||
/* JavaScript */
|
||||
browserify: {
|
||||
files: ['js/*.js'],
|
||||
files: ['js/*.js_t','js/*.js'],
|
||||
tasks: ['browserify:dev']
|
||||
},
|
||||
/* live-reload the docs if sphinx re-builds */
|
||||
|
||||
@@ -66,7 +66,11 @@ function ThemeNav () {
|
||||
// TODO remove this with a split in theme and Read the Docs JS logic as
|
||||
// well, it's only here to support 0.3.0 installs of our theme.
|
||||
nav.enableSticky = function() {
|
||||
{%- if theme_sticky_navigation|tobool %}
|
||||
this.enable(true);
|
||||
{%- else %}
|
||||
this.enable(false);
|
||||
{%- endif %}
|
||||
};
|
||||
|
||||
nav.init = function ($) {
|
||||
@@ -239,3 +243,15 @@ if (typeof(window) != 'undefined') {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}());
|
||||
|
||||
{# Do not conflict with RTD insertion of analytics script #}
|
||||
{%- if not READTHEDOCS %}
|
||||
{%- if theme_analytics_id %}
|
||||
window.addEventListener("load", function(){
|
||||
ga('create', '{{ theme_analytics_id }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
})
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
<script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
|
||||
{%- if not READTHEDOCS %}
|
||||
{%- if theme_analytics_id %}
|
||||
<script src="https://ssl.google-analytics.com/analytics.js" async id="ga"></script>
|
||||
{%- endif %}
|
||||
{%- endif %}
|
||||
|
||||
{# OPENSEARCH #}
|
||||
{%- if use_opensearch %}
|
||||
@@ -204,31 +209,7 @@
|
||||
</section>
|
||||
|
||||
</div>
|
||||
{% include "versions.html" %}
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable({{ 'true' if theme_sticky_navigation|tobool else 'false' }});
|
||||
});
|
||||
</script>
|
||||
|
||||
{# Do not conflict with RTD insertion of analytics script #}
|
||||
{% if not READTHEDOCS %}
|
||||
{% if theme_analytics_id %}
|
||||
<!-- Theme Analytics -->
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '{{ theme_analytics_id }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{%- include "versions.html" %}
|
||||
{%- block footer %} {% endblock %}
|
||||
|
||||
</body>
|
||||
|
||||
@@ -10,15 +10,10 @@
|
||||
{%- extends "layout.html" %}
|
||||
{% set title = _('Search') %}
|
||||
{% set script_files = script_files + ['_static/searchtools.js'] %}
|
||||
{% block footer %}
|
||||
<script type="text/javascript">
|
||||
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
|
||||
</script>
|
||||
{# this is used when loading the search index using $.ajax fails,
|
||||
such as on Chrome for documents on localhost #}
|
||||
<script type="text/javascript" id="searchindexloader"></script>
|
||||
{%- block extrahead %}
|
||||
<script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}" defer></script>
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
{%- endblock %}
|
||||
{% block body %}
|
||||
<noscript>
|
||||
<div id="fallback" class="admonition warning">
|
||||
|
||||
Reference in new issue
Block a user