Remove navigation/related bar in default theme

862 views
Skip to first unread message

Jack Morgan

unread,
Nov 4, 2012, 6:45:29 PM11/4/12
to sphin...@googlegroups.com
Is there an easy modification to removing the navigation bar (it's called 'related' in the HTML) from the default theme? I could change to a different theme that doesn't have it built in, but then I would need to rework more things (might be worth it though).

Currently I've done it by adding some custom CSS to hide the top bar, then raise the sidebar and body to fill the gap.

Jonathan Waltman

unread,
Nov 5, 2012, 3:36:27 AM11/5/12
to sphin...@googlegroups.com
The configuration variable `html_sidebars` can be used to specify
which sidebars are generated.

See http://sphinx-doc.org/config.html?highlight=sidebar#confval-html_sidebars

--
Jonathan Waltman

Jack Morgan

unread,
Nov 7, 2012, 8:11:25 PM11/7/12
to sphin...@googlegroups.com
I couldn't seem to find what I was looking for. I'm trying to turn off this bar:

 

Jonathan Waltman

unread,
Nov 8, 2012, 1:15:27 AM11/8/12
to sphin...@googlegroups.com
On Wed, Nov 7, 2012 at 7:11 PM, Jack Morgan <jackmor...@gmail.com> wrote:
>
> I couldn't seem to find what I was looking for. I'm trying to turn off
> this bar:

The `html_sidebars' do not affect the navigation bar. Sorry for
pointing you in the wrong direction.

To omit the navigation bar, you can override the theme's "layout.html"
template by creating a file "_templates/layout.html" with the
following content:

{% extends "!layout.html" %}

{# Omit the top navigation bar. #}
{% block relbar1 %}
{% endblock %}

{# Omit the bottom navigation bar. #}
{% block relbar2 %}
{% endblock %}


--
Jonathan Waltman
Reply all
Reply to author
Forward
0 new messages