readthedocs/sphinx_rtd_theme

breadcrumbs_aside should not contain github links for generated files

Open

#765 geöffnet am 24. Mai 2019

Auf GitHub ansehen
 (3 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)CSS (1.413 Forks)batch import
AcceptedBugGood First Issue

Repository-Metriken

Stars
 (3.473 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Problem

By default, my search and genindex pages contain a link "Edit on GitHub" but they naturally don't exist in the git. This should not be the case.

Reproducible Project

https://framagit.org/simgrid/simgrid/tree/master/docs/source Build logs are available from "pages" tasks on https://framagit.org/simgrid/simgrid/-/jobs But I have a local fix, so you won't see much in the logs ;)

Proposed fix

Here is my _templates/breadcrumbs.html file. This fixes the problem for me.

{%- extends "sphinx_rtd_theme/breadcrumbs.html" %}

{% block breadcrumbs_aside %}
  <li class="wy-breadcrumbs-aside">
    {% if hasdoc(pagename) and pagename != "search" and pagename != "genindex" %}
      <a href="{{ meta['framagit_url'] }}" class="fa fa-bitbucket"> {{ _('Edit on FramaGit') }}</a>
    {% endif %}
  </li>
{% endblock %}

The important thing is pagename != "search" and pagename != "genindex" in the conditional.

Note that I also edit the link name because I'm not using the central gitlab instance.

Environment Info

My requirements.txt reads:

breathe
javasphinx
sphinx>=1.8.0
sphinx_rtd_theme

Contributor Guide