From 7f845ffcd96fa82615c758e1b19f72d0f6002edf Mon Sep 17 00:00:00 2001 From: Sandra McCann Date: Wed, 5 Jun 2019 16:28:02 -0400 Subject: [PATCH] fix breadcrumbs (#57426) --- .../_themes/sphinx_rtd_theme/breadcrumbs.html | 101 +++++++++++++++--- docs/docsite/rst/conf.py | 11 +- 2 files changed, 97 insertions(+), 15 deletions(-) diff --git a/docs/docsite/_themes/sphinx_rtd_theme/breadcrumbs.html b/docs/docsite/_themes/sphinx_rtd_theme/breadcrumbs.html index 0b4eb150bf..bf10e0c229 100644 --- a/docs/docsite/_themes/sphinx_rtd_theme/breadcrumbs.html +++ b/docs/docsite/_themes/sphinx_rtd_theme/breadcrumbs.html @@ -1,15 +1,88 @@ - -
+{# Support for Sphinx 1.3+ page_source_suffix, but don't break old builds. #} + +{% if page_source_suffix %} +{% set suffix = page_source_suffix %} +{% else %} +{% set suffix = source_suffix %} +{% endif %} + +{% 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 %} +{% endif %} + +{% if check_meta and 'bitbucket_url' in meta %} +{% set display_bitbucket = True %} +{% endif %} + +{% if check_meta and 'gitlab_url' in meta %} +{% set display_gitlab = True %} +{% endif %} + +
+ + + + {% if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %} + + {% endif %} +
+
diff --git a/docs/docsite/rst/conf.py b/docs/docsite/rst/conf.py index 02792bc938..a9e43ec40e 100644 --- a/docs/docsite/rst/conf.py +++ b/docs/docsite/rst/conf.py @@ -129,7 +129,16 @@ html_short_title = 'Ansible Documentation' html_theme_options = { 'canonical_url': "https://docs.ansible.com/ansible/latest/", - 'collapse_navigation': "True" + 'collapse_navigation': "True", + 'vcs_pageview_mode': 'edit' +} + +html_context = { + 'display_github': 'True', + 'github_user': 'ansible', + 'github_repo': 'ansible', + 'github_version': 'devel/docs/docsite/rst/', + 'github_module_version': 'devel/lib/ansible/modules/' } # The style sheet to use for HTML and HTML Help pages. A file of that name