mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Respect html_show_sourcelink
setting
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_show_sourcelink Also simplify check to disable source linking on search page.
This commit is contained in:
parent
8d4d394dad
commit
d698f72fae
@ -16,7 +16,18 @@
|
||||
{%- set display_gitlab = True %}
|
||||
{%- endif %}
|
||||
|
||||
{%- set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %}
|
||||
{%- set sourcelinks = True %}
|
||||
{%- if html_show_sourcelink is false %}
|
||||
{#- https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_show_sourcelink -#}
|
||||
{%- set sourcelinks = False %}
|
||||
{%- elif hasdoc(pagename) is false %}
|
||||
{#- disable for autogenerated pages -#}
|
||||
{%- set sourcelinks = False %}
|
||||
{%- elif pagename == 'search' %}
|
||||
{#- explicitly disable for search page -#}
|
||||
{#- https://github.com/readthedocs/sphinx_rtd_theme/issues/934 -#}
|
||||
{%- set sourcelinks = False %}
|
||||
{%- endif %}
|
||||
|
||||
{#- Translators: This is an ARIA section label for page links, including previous/next page link and links to GitHub/GitLab/etc. -#}
|
||||
<div role="navigation" aria-label="{{ _('Page navigation') }}">
|
||||
@ -30,7 +41,7 @@
|
||||
{%- endblock %}
|
||||
{%- block breadcrumbs_aside %}
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
{%- if hasdoc(pagename) and display_vcs_links %}
|
||||
{%- if sourcelinks %}
|
||||
{%- if display_github %}
|
||||
{%- if check_meta and 'github_url' in meta %}
|
||||
<!-- User defined GitHub URL -->
|
||||
|
@ -9,7 +9,6 @@
|
||||
#}
|
||||
{%- extends "layout.html" %}
|
||||
{% set title = _('Search') %}
|
||||
{% set display_vcs_links = False %}
|
||||
{%- block scripts %}
|
||||
{{ super() }}
|
||||
<script src="{{ pathto('_static/searchtools.js', 1) }}"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user