From 436d078dee68767bdd533e95c25aa0b8ff947ab2 Mon Sep 17 00:00:00 2001 From: Sho Shimauchi Date: Sun, 1 Jun 2014 22:20:56 +0900 Subject: [PATCH 1/3] add relbar (breadcrumbs) --- README.rst | 4 +++ demo/source/conf.py | 4 +++ sphinx_bootstrap_theme/bootstrap/layout.html | 32 ++++++++++++++++++-- sphinx_bootstrap_theme/bootstrap/theme.conf | 4 +++ 4 files changed, 41 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 2fe0d917..4026b498 100644 --- a/README.rst +++ b/README.rst @@ -129,6 +129,10 @@ your "conf.py" file:: # Options are "nav" (default), "footer" or anything else to exclude. 'source_link_position': "nav", + # If use relbar (breadcrumbs) or not. + # Values: "true" or "false" (default) + 'relbar_enable': "false", + # Bootswatch (http://bootswatch.com/) theme. # # Options are nothing with "" (default) or the name of a valid theme diff --git a/demo/source/conf.py b/demo/source/conf.py index 574b75d7..ebb65631 100644 --- a/demo/source/conf.py +++ b/demo/source/conf.py @@ -134,6 +134,10 @@ # Options are "nav" (default), "footer" or anything else to exclude. 'source_link_position': "nav", + # If use relbar (breadcrumbs) or not. + # Values: "true" or "false" (default) + 'relbar_enable': "true", + # Bootswatch (http://bootswatch.com/) theme. # # Options are nothing with "" (default) or the name of a valid theme such diff --git a/sphinx_bootstrap_theme/bootstrap/layout.html b/sphinx_bootstrap_theme/bootstrap/layout.html index 18e16904..753101d5 100644 --- a/sphinx_bootstrap_theme/bootstrap/layout.html +++ b/sphinx_bootstrap_theme/bootstrap/layout.html @@ -93,10 +93,36 @@ {% endblock %} -{# Silence the sidebar's, relbar's #} +{# Silence the sidebar's #} {% block header %}{% endblock %} -{% block relbar1 %}{% endblock %} -{% block relbar2 %}{% endblock %} + +{%- block relbar1 %} + {%- if theme_relbar_enable == "true" %} + {{ relbar_bootstrap() }} + {%- endif %} +{% endblock %} + +{%- block relbar2 %} + {%- if theme_relbar_enable == "true" %} + {{ relbar_bootstrap() }} + {%- endif %} +{% endblock %} + +{%- macro relbar_bootstrap() %} + +{%- endmacro %} + {% block sidebarsourcelink %}{% endblock %} {%- block content %} diff --git a/sphinx_bootstrap_theme/bootstrap/theme.conf b/sphinx_bootstrap_theme/bootstrap/theme.conf index 1fc2ecef..3c77696a 100644 --- a/sphinx_bootstrap_theme/bootstrap/theme.conf +++ b/sphinx_bootstrap_theme/bootstrap/theme.conf @@ -47,6 +47,10 @@ navbar_fixed_top = true # Options are "nav" (default), "footer" or anything else to exclude. source_link_position = nav +# If use relbar (breadcrumbs) or not. +# Values: "true" or "false" (default) +relbar_enable = false + # Bootswatch (http://bootswatch.com/) theme. # # Options are nothing with "" (default) or the name of a valid theme such as From 40749750e8f130d342035a827efc8a0397c96f03 Mon Sep 17 00:00:00 2001 From: Sho Shimauchi Date: Mon, 2 Jun 2014 07:33:23 +0900 Subject: [PATCH 2/3] add an example page for relbar --- demo/source/subdir/index.rst | 4 ++++ demo/source/subdir/relbar_example.rst | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 demo/source/subdir/relbar_example.rst diff --git a/demo/source/subdir/index.rst b/demo/source/subdir/index.rst index e68659aa..a50fb4c0 100644 --- a/demo/source/subdir/index.rst +++ b/demo/source/subdir/index.rst @@ -4,6 +4,10 @@ Subdirectory Page This page is in a subdirectory. +.. toctree:: + + relbar_example + Headings ======== This is a first level heading (``h1``). diff --git a/demo/source/subdir/relbar_example.rst b/demo/source/subdir/relbar_example.rst new file mode 100644 index 00000000..7042e795 --- /dev/null +++ b/demo/source/subdir/relbar_example.rst @@ -0,0 +1,9 @@ +========================= + Example Page for relbar +========================= + +This page is an example for relbar (breadcrumbs). + +See the top nad the bottom of this page. + + From 0217194b214671706814aca9000f5b0445c11d66 Mon Sep 17 00:00:00 2001 From: Sho Shimauchi Date: Mon, 2 Jun 2014 07:43:55 +0900 Subject: [PATCH 3/3] fix wrong indentation --- sphinx_bootstrap_theme/bootstrap/layout.html | 24 ++++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sphinx_bootstrap_theme/bootstrap/layout.html b/sphinx_bootstrap_theme/bootstrap/layout.html index 753101d5..58f6079d 100644 --- a/sphinx_bootstrap_theme/bootstrap/layout.html +++ b/sphinx_bootstrap_theme/bootstrap/layout.html @@ -109,18 +109,18 @@ {% endblock %} {%- macro relbar_bootstrap() %} - + {%- endmacro %} {% block sidebarsourcelink %}{% endblock %}