Skip to content

Commit c8efa02

Browse files
stijnvanhoeyjorisvandenbossche
authored andcommitted
Use main sphinx level for navbar items (pandas-dev#15)
1 parent 457d8a8 commit c8efa02

File tree

6 files changed

+17
-39
lines changed

6 files changed

+17
-39
lines changed

pandas-docs/source/_themes/bootstrap_docs_theme/docs-navbar.html

+6-21
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,12 @@
1212
<li class="nav-item">
1313
<a class="nav-link" href="{{ pathto('index') }}">Home</a>
1414
</li>
15-
<li class="nav-item">
16-
<a class="nav-link" href="{{ pathto('getting_started/index') }}">Getting Started</a>
17-
</li>
18-
<li class="nav-item">
19-
<a class="nav-link" href="{{ pathto('user_guide/index') }}">User Guide</a>
15+
{% set nav = get_nav_object(maxdepth=1) %}
16+
{% for main_nav_item in nav %}
17+
<li class="nav-item {% if main_nav_item.active%}active{% endif %}">
18+
<a class="nav-link" href="{{ main_nav_item.url }}">{{ main_nav_item.title }}</a>
2019
</li>
21-
<li class="nav-item">
22-
<a class="nav-link" href="{{ pathto('reference/index') }}">API Reference</a>
23-
</li>
24-
<li class="nav-item">
25-
<a class="nav-link" href="{{ pathto('development/index') }}">Development</a>
26-
</li>
27-
<li class="nav-item">
28-
<a class="nav-link" href="{{ pathto('whatsnew/index') }}">Release Notes</a>
29-
</li>
20+
{% endfor %}
3021
</ul>
3122
<ul class="navbar-nav ml-auto">
3223
<li class="nav-item">
@@ -39,11 +30,5 @@
3930
<span><i class="fab fa-twitter" style="color:#55acee;font-size:1rem;line-height:1.25"></i></span>
4031
</a>
4132
</li>
42-
<li class="nav-item">
43-
<a class="nav-link" href="{{ pathto('install') }}">
44-
<span>
45-
<span class="btn btn-primary d-lg-inline-block mb-3 mb-md-0 ml-md-3">Install</span>
46-
</span>
47-
</a>
48-
</li>
4933
</ul>
34+
</div>

pandas-docs/source/_themes/bootstrap_docs_theme/docs-sidebar.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<ul>
2020
{% for nav_item in nav_item.children %}
2121
<li class="{% if nav_item.active%}active bd-sidenav-active{% endif %}">
22-
<a href="{{ nav_item.url }}"">{{ nav_item.title }}</a>
22+
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
2323
</li>
2424
{% endfor %}
2525
</ul>

pandas-docs/source/_themes/bootstrap_docs_theme/layout.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
{%- endblock %}
2828
{%- block content %}
2929
<nav class="navbar navbar-light navbar-expand-lg bg-light fixed-top bd-navbar" id="navbar-main">
30-
<div class="container">
31-
{%- include "docs-navbar.html" %}
32-
</div>
30+
{%- include "docs-navbar.html" %}
3331
</nav>
3432

3533
<div class="container-fluid">

pandas-docs/source/_themes/bootstrap_docs_theme/static/css/custom.css

+9-11
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99

1010
.navbar-nav li a {
1111
padding: 0 15px;
12-
line-height: 50px;
12+
/* line-height: 50px; */
1313
}
1414
.navbar-header a {
1515
padding: 0 15px;
16-
line-height: 50px;
16+
/* line-height: 50px; */
1717
}
1818

1919
.bd-search {
@@ -51,6 +51,7 @@
5151
.section-nav {
5252
padding-left: 0;
5353
border-left: 1px solid #eee;
54+
border-bottom: none;
5455
}
5556

5657
.section-nav ul {
@@ -182,15 +183,7 @@
182183
background-color: transparent; */
183184
}
184185

185-
/* minimal copy paste from bootstrap docs css to get fixed-top height navbar handling ok */
186-
187-
.bd-navbar {
188-
position: -webkit-sticky;
189-
position: sticky;
190-
top: 0;
191-
z-index: 1071;
192-
}
193-
186+
194187
/* offsetting html anchor titles to adjust for fixed header, https://github.com/pandas-dev/pandas-sphinx-theme/issues/6*/
195188
h2::before, h3::before,
196189
h4::before, h5::before,
@@ -201,6 +194,11 @@
201194
margin: -80px 0 0;
202195
}
203196

197+
/* add padding to body to avid overlap with navbar */
198+
body {
199+
padding-top: 80px
200+
}
201+
204202

205203
/* adjust toc font sizes to improve overview */
206204
.toc-h2 {
File renamed without changes.

pandas-docs/source/index.rst.template

-3
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ See the :ref:`overview` for more detail about what's in the library.
4040
{% endif %}
4141

4242
{% if not single_doc -%}
43-
What's New in 0.25.0 <whatsnew/v0.25.0>
44-
install
4543
getting_started/index
4644
user_guide/index
47-
ecosystem
4845
{% endif -%}
4946
{% if include_api -%}
5047
reference/index

0 commit comments

Comments
 (0)