diff --git a/docs/source/_templates/breadcrumbs.html b/docs/source/_templates/breadcrumbs.html new file mode 100644 index 0000000000..0d7ebd1b59 --- /dev/null +++ b/docs/source/_templates/breadcrumbs.html @@ -0,0 +1,97 @@ +{# 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 %} + +
diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html index 6f5fcc55e2..6ecb2a54f1 100644 --- a/docs/source/_templates/layout.html +++ b/docs/source/_templates/layout.html @@ -2,7 +2,7 @@ {% block sidebartitle %} {% include "searchbox.html" %} {% endblock %} diff --git a/docs/source/conf.py b/docs/source/conf.py index aa02f0cf9a..987cac93ce 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -176,6 +176,15 @@ def _get_pattern(): version = f"Nightly Build ({torchaudio.__version__})" release = "nightly" + +# +# Specify the version of the current stable release. +# Used in `docs/source/_templates/breadcrumbs.html` +# +# https://stackoverflow.com/a/33845358/1106930 +# +html_context = {"version_stable": "2.0.1"} + # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path