Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breadcrumbs_aside should not contain github links for generated files #765

Open
mquinson opened this issue May 24, 2019 · 3 comments
Open
Labels
Accepted Accepted issue on our roadmap Bug A bug Good First Issue Good for new contributors

Comments

@mquinson
Copy link

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
@stsewd
Copy link
Member

stsewd commented Oct 8, 2020

I fixed the one from search in #935 but looks like a regression happened and now it still displays the link (guessing this pallets/jinja#994).. .Looks like your solution is better anyway :) feel free to open a PR!

@stsewd stsewd added Accepted Accepted issue on our roadmap Bug A bug labels Oct 8, 2020
@stsewd
Copy link
Member

stsewd commented Oct 8, 2020

also, I'd use pagename not in {'search', 'genindex'} instead of multiple "and"

@Blendify Blendify added the Good First Issue Good for new contributors label Apr 22, 2021
@saraedum
Copy link

The search page does not have that link anymore actually. To also hide it on genindex I am using this in _templates/breadcrumbs.html.

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

{% block breadcrumbs_aside %}
  {% if pagename not in ['genindex'] %}
    {{ super() }}
  {% endif %}
{% endblock %}

saraedum added a commit to saraedum/svgdigitizer that referenced this issue Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Bug A bug Good First Issue Good for new contributors
Projects
None yet
Development

No branches or pull requests

4 participants