breadcrumbs.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {%- if meta is defined and meta is not none %}
  2. {%- set check_meta = True %}
  3. {%- else %}
  4. {%- set check_meta = False %}
  5. {%- endif %}
  6. {%- if check_meta and 'github_url' in meta %}
  7. {%- set display_github = True %}
  8. {%- endif %}
  9. {%- if check_meta and 'bitbucket_url' in meta %}
  10. {%- set display_bitbucket = True %}
  11. {%- endif %}
  12. {%- if check_meta and 'gitlab_url' in meta %}
  13. {%- set display_gitlab = True %}
  14. {%- endif %}
  15. {%- set display_vcs_links = display_vcs_links if display_vcs_links is defined else True %}
  16. {#- Translators: This is an ARIA section label for page links, including previous/next page link and links to GitHub/GitLab/etc. -#}
  17. <div role="navigation" aria-label="{{ _('Page navigation') }}">
  18. <ul class="wy-breadcrumbs">
  19. {%- block breadcrumbs %}
  20. <li><a href="{{ pathto(master_doc) }}" class="icon icon-home"></a> &raquo;</li>
  21. {%- for doc in parents %}
  22. <li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
  23. {%- endfor %}
  24. <li>{{ title }}</li>
  25. {%- endblock %}
  26. {%- block breadcrumbs_aside %}
  27. <li class="wy-breadcrumbs-aside">
  28. {%- if hasdoc(pagename) and display_vcs_links %}
  29. {%- if display_github %}
  30. {%- if check_meta and 'github_url' in meta %}
  31. <!-- User defined GitHub URL -->
  32. <a href="{{ meta['github_url'] }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
  33. {%- else %}
  34. <a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/{{ theme_vcs_pageview_mode or "blob" }}/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ page_source_suffix }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
  35. {%- endif %}
  36. {%- elif display_bitbucket %}
  37. {%- if check_meta and 'bitbucket_url' in meta %}
  38. <!-- User defined Bitbucket URL -->
  39. <a href="{{ meta['bitbucket_url'] }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
  40. {%- else %}
  41. <a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ page_source_suffix }}?mode={{ theme_vcs_pageview_mode or "view" }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
  42. {%- endif %}
  43. {%- elif display_gitlab %}
  44. {%- if check_meta and 'gitlab_url' in meta %}
  45. <!-- User defined GitLab URL -->
  46. <a href="{{ meta['gitlab_url'] }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
  47. {%- else %}
  48. <a href="https://{{ gitlab_host|default("gitlab.com") }}/{{ gitlab_user }}/{{ gitlab_repo }}/{{ theme_vcs_pageview_mode or "blob" }}/{{ gitlab_version }}{{ conf_py_path }}{{ pagename }}{{ page_source_suffix }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
  49. {%- endif %}
  50. {%- elif show_source and source_url_prefix %}
  51. <a href="{{ source_url_prefix }}{{ pagename }}{{ page_source_suffix }}">{{ _('View page source') }}</a>
  52. {%- elif show_source and has_source and sourcename %}
  53. <a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> {{ _('View page source') }}</a>
  54. {%- endif %}
  55. {%- endif %}
  56. </li>
  57. {%- endblock %}
  58. </ul>
  59. {%- if (theme_prev_next_buttons_location == 'top' or theme_prev_next_buttons_location == 'both') and (next or prev) %}
  60. {#- Translators: This is an ARIA section label for sequential page links, such as previous and next page links. -#}
  61. <div class="rst-breadcrumbs-buttons" role="navigation" aria-label="{{ _('Sequential page navigation') }}">
  62. {%- if prev %}
  63. <a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> {{ _('Previous') }}</a>
  64. {%- endif %}
  65. {%- if next %}
  66. <a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">{{ _('Next') }} <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
  67. {%- endif %}
  68. </div>
  69. {%- endif %}
  70. <hr/>
  71. </div>