diff --git a/tutorials/themes/tutorials-theme/layout.html b/tutorials/themes/tutorials-theme/layout.html index 972a0f9c0..1acf6d24e 100644 --- a/tutorials/themes/tutorials-theme/layout.html +++ b/tutorials/themes/tutorials-theme/layout.html @@ -48,13 +48,6 @@ - {# this script is to redirect /tutorials.html to /tutorials.html?q=filterTutorials #} - @@ -82,13 +75,13 @@ {% else %} {%- set content_card = "content-padding card" %} {% endif %} - + {% if pagename != "search" and pagename != "index" and pagename != "tutorials" and pagename != "documentation" and pagename != "examples" and pagename != "guides" %}
+
{%- set bs_content_width = "9" %} {% endif %} @@ -96,10 +89,10 @@

Table of contents

{% block body %}{% endblock %}
-
+
{% if pagename == "tutorials" %} {# This is where the tutorials will be injected based on the filters #} -
+
{% endif %} @@ -118,7 +111,7 @@

Table of contents

{% trans sphinx_version=sphinx_version|e %}Created using Sphinx {{ sphinx_version }}.{% endtrans %} - {% trans copyright=copyright|e %}© Copyright Astropy.{% endtrans %} + {% trans copyright=copyright|e %}© Copyright Astropy.{% endtrans %}

diff --git a/tutorials/themes/tutorials-theme/navbar.html b/tutorials/themes/tutorials-theme/navbar.html index ef54276e9..e492c0d28 100644 --- a/tutorials/themes/tutorials-theme/navbar.html +++ b/tutorials/themes/tutorials-theme/navbar.html @@ -20,7 +20,7 @@

-

Tutorials

+

Tutorials

Tutorials are step-by-step cookbooks for common activities that incorporate several packages. They are more specific and less conceptual than Guides but more extended than Examples.

diff --git a/tutorials/themes/tutorials-theme/static/searchtools.js b/tutorials/themes/tutorials-theme/static/searchtools.js index 0cac3e472..c97ca15d0 100644 --- a/tutorials/themes/tutorials-theme/static/searchtools.js +++ b/tutorials/themes/tutorials-theme/static/searchtools.js @@ -337,9 +337,12 @@ var Search = { var params = $.getQueryParameters(); if (params.q) { var query = params.q[0]; - $('input[name="q"]')[0].value = query; - this.performSearch(query); + } else { + // If no query string is passed, assume we want to filterTutorials + var query = "filterTutorials"; } + $('input[name="q"]')[0].value = query; + this.performSearch(query); }, loadIndex : function(url) { @@ -410,7 +413,7 @@ var Search = { this.deferQuery(query); //Perform search in Astropy Documentation - if(window.location.search.search("filterTutorials")==-1){ //if filtered by tutorials, then no need to search in Astropy Documentation + if (query.includes("filterTutorials")) { // don't search docs if we are just looking for tutorials var docResponse = null; var docResult = ''; $.get('https://readthedocs.org/api/v2/docsearch/?q=' + window.location.search.split('=')[1] + '&project=astropy&version=stable&language=en', function(response){