From 6360a2ed42be75a50b5ab855c983b0ec298e19f5 Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Fri, 3 Apr 2015 10:57:39 +0100 Subject: [PATCH] Remove broken "Edit on GitHub/Bitbucket" link from search pages On a page of search results, the "Edit on GitHub/Bitbucket" link tries to send the reader to a file "search.rst" or "search.txt" in the repository. Since the search results only exist as a template, this is a 404'd link. This change to the template means that the "Edit on GitHub/Bitbucket" link is not shown on search pages, getting rid of this broken link. --- sphinx_rtd_theme/breadcrumbs.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/sphinx_rtd_theme/breadcrumbs.html b/sphinx_rtd_theme/breadcrumbs.html index af4f55a46..0028421e1 100644 --- a/sphinx_rtd_theme/breadcrumbs.html +++ b/sphinx_rtd_theme/breadcrumbs.html @@ -6,14 +6,16 @@ {% endfor %}
  • {{ title }}
  • - {% if display_github %} - Edit on GitHub - {% elif display_bitbucket %} - Edit on Bitbucket - {% elif show_source and source_url_prefix %} - View page source - {% elif show_source and has_source and sourcename %} - View page source + {% if pagename != "search" %} + {% if display_github %} + Edit on GitHub + {% elif display_bitbucket %} + Edit on Bitbucket + {% elif show_source and source_url_prefix %} + View page source + {% elif show_source and has_source and sourcename %} + View page source + {% endif %} {% endif %}