diff --git a/sphinx_rtd_theme/breadcrumbs.html b/sphinx_rtd_theme/breadcrumbs.html index bd45b6d7c..d18251219 100644 --- a/sphinx_rtd_theme/breadcrumbs.html +++ b/sphinx_rtd_theme/breadcrumbs.html @@ -1,19 +1,32 @@ -{%- if meta is defined and meta is not none %} - {%- set check_meta = True %} -{%- else %} - {%- set check_meta = False %} -{%- endif %} - -{%- if check_meta and 'github_url' in meta %} - {%- set display_github = True %} +{%- if display_github %} + {% set github_sourcelink %} + {%- if meta and 'github_url' in meta %} + {#- "meta" or "front matter" is data defined inside a page -#} + {{ _('Edit on GitHub') }} + {%- else %} + {{ _('Edit on GitHub') }} + {%- endif %} + {% endset %} {%- endif %} -{%- if check_meta and 'bitbucket_url' in meta %} - {%- set display_bitbucket = True %} +{%- if display_bitbucket %} + {% set bitbucket_sourcelink %} + {%- if meta and 'bitbucket_url' in meta %} + {{ _('Edit on Bitbucket') }} + {%- else %} + {{ _('Edit on Bitbucket') }} + {%- endif %} + {% endset %} {%- endif %} -{%- if check_meta and 'gitlab_url' in meta %} - {%- set display_gitlab = True %} +{%- if display_gitlab %} + {% set gitlab_sourcelink %} + {%- if meta and 'gitlab_url' in meta %} + {{ _('Edit on GitLab') }} + {%- else %} + {{ _('Edit on GitLab') }} + {%- endif %} + {% endset %} {%- endif %} {%- set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %} @@ -31,27 +44,12 @@ {%- block breadcrumbs_aside %}