Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add relbar (breadcrumbs) #102

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions demo/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions demo/source/subdir/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Subdirectory Page

This page is in a subdirectory.

.. toctree::

relbar_example

Headings
========
This is a first level heading (``h1``).
Expand Down
9 changes: 9 additions & 0 deletions demo/source/subdir/relbar_example.rst
Original file line number Diff line number Diff line change
@@ -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.


32 changes: 29 additions & 3 deletions sphinx_bootstrap_theme/bootstrap/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,36 @@
<meta name="apple-mobile-web-app-capable" content="yes">
{% 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() %}
<div class="container" role="navigation" aria-label="related navigation">
<ol class="breadcrumb">
{%- block rootrellink %}
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a></li>
{%- endblock %}
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a></li>
{%- endfor %}
<li class="active">{{ title }}</li>
{%- block relbaritems %} {% endblock %}
</ol>
</div>
{%- endmacro %}

{% block sidebarsourcelink %}{% endblock %}

{%- block content %}
Expand Down
4 changes: 4 additions & 0 deletions sphinx_bootstrap_theme/bootstrap/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down