Skip to content

Commit 768fb03

Browse files
authored
Merge pull request #10942 from IQSS/10941-remove-custom-guides-navbar
Guides: improve navigation
2 parents cb379c1 + 4bbb21c commit 768fb03

File tree

10 files changed

+35
-101
lines changed

10 files changed

+35
-101
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Navigation across the guides has been improved. You can now click in the upper left to go "home". The navbar has been simplified with fewer links. The bottom of every page now has "Next" and "Previous" links. A "Source" link at the bottom has also been added. See #10942.

doc/sphinx-guides/source/_static/docsdataverse_org.css

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ iframe {
3535

3636
a.navbar-brand, a.navbar-brand:hover {
3737
color:#C55B28 !important;
38+
height: 50px;
39+
background: rgba(0, 0, 0, 0) url("../_static/images/dataverseicon.png") no-repeat scroll 0 8px;
40+
line-height: 20px;
41+
padding-left: 26px;
3842
}
3943
span.navbar-brand {color:#C55B28 !important; padding-left: 32px; height: 50px;}
4044
span.navbar-brand .icon-dataverse {color:#C55B28; font-size:28px; margin: -4px 0 0 -27px; position: absolute;}
@@ -48,13 +52,6 @@ ul.navbar-nav li.dropdown.open > span.dropdown-toggle {background: #e7e7e7;}
4852
.text-dataset {color:#31708F;}
4953
.text-file {color:#777777;}
5054

51-
#dataverse-org-homepage-url {
52-
height: 50px;
53-
background: rgba(0, 0, 0, 0) url("../_static/images/dataverseicon.png") no-repeat scroll 0 8px;
54-
line-height: 20px;
55-
padding-left: 26px;
56-
}
57-
5855
.navbar-default .navbar-nav > li > a {
5956
color: #303030 !important;
6057
}
@@ -189,4 +186,4 @@ div.sphinx-tabs {
189186

190187
li div.sphinx-tabs {
191188
padding-left: 0;
192-
}
189+
}

doc/sphinx-guides/source/_static/navbar_from_dataverse_org.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

doc/sphinx-guides/source/_templates/navbar.html

Lines changed: 0 additions & 70 deletions
This file was deleted.

doc/sphinx-guides/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
# ("Link", "http://example.com", True),
145145
# ],
146146
'navbar_links': [
147-
("View 3.6.2 Guides", "http://docs.dataverse.org/en/3.6.2/", True),
147+
("About Dataverse", "https://dataverse.org", True),
148148
],
149149

150150
# Global TOC depth for "site" navbar tab. (Default: 1)

doc/sphinx_bootstrap_theme/bootstrap/globaltoc.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<li class="dropdown globaltoc-container">
2+
<!-- Comment out "Site" from navbar (we list guides in the sidebar anyway) -->
3+
<!--
24
<a role="button"
35
id="dLabelGlobalToc"
46
data-toggle="dropdown"
57
data-target="#"
68
href="{{ pathto(master_doc) }}">{{ theme_navbar_site_name }} <b class="caret"></b></a>
9+
-->
710
<ul class="dropdown-menu globaltoc"
811
role="menu"
912
aria-labelledby="dLabelGlobalToc">{{ toctree(maxdepth=theme_globaltoc_depth|toint, collapse=False, includehidden=theme_globaltoc_includehidden|tobool) }}</ul>

doc/sphinx_bootstrap_theme/bootstrap/layout.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,22 @@
8686
{%- block sidebar1 %}{{ bsidebar() }}{% endblock %}
8787
<div class="{{ bs_span_prefix }}{{ bs_content_width }} content" role="main">
8888
{% block body %}{% endblock %}
89+
<!-- Previous button -->
90+
{%- if prev %}
91+
<a href="{{ prev.link|e }}" title="{{ _('Previous Chapter: ') + prev.title|striptags }}">
92+
{%- if theme_bootstrap_version == "2" -%}<span class="icon-chevron-left visible-tablet"></span>{%- endif -%}
93+
{%- if theme_bootstrap_version == "3" -%}<span class="glyphicon glyphicon-chevron-left visible-sm"></span>{%- endif -%}
94+
<span class="hidden-sm hidden-tablet">{{ "&laquo;Previous"|safe }}</span>
95+
</a>
96+
{%- endif %}
97+
<!-- Next button -->
98+
{%- if next %}
99+
<a href="{{ next.link|e }}" title="{{ _('Next Chapter: ') + next.title|striptags }}" style="float: right;">
100+
{%- if theme_bootstrap_version == "2" -%}<span class="icon-chevron-right visible-tablet"></span>{%- endif -%}
101+
{%- if theme_bootstrap_version == "3" -%}<span class="glyphicon glyphicon-chevron-right visible-sm"></span>{%- endif -%}
102+
<span class="hidden-sm hidden-tablet">{{ "Next&raquo"|safe }}</span>
103+
</a>
104+
{%- endif %}
89105
</div>
90106
{% block sidebar2 %} {# possible location for sidebar #} {% endblock %}
91107
</div>

doc/sphinx_bootstrap_theme/bootstrap/navbar.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
{%- block sidebarlogo %}
1212
{%- if logo %}<span><img src="{{ pathto('_static/' + logo, 1) }}"></span>{%- endif %}
1313
{%- endblock %}
14-
{% if theme_navbar_title -%}{{ theme_navbar_title|e }}{%- else -%}{{ project|e }}{%- endif -%}
14+
{% if theme_navbar_title -%}{{ theme_navbar_title|e }}{%- else -%}Dataverse Guides{%- endif -%}
1515
</a>
16-
<span class="navbar-text navbar-version pull-left"><b>{{ version|e }}</b></span>
16+
<span class="navbar-text navbar-version pull-left"><b><a href="{{ pathto('versions') }}">v{{ version|e }}</a></b></span>
1717
</div>
1818

1919
<div class="collapse navbar-collapse nav-collapse">
@@ -31,7 +31,10 @@
3131
{% endblock %}
3232
{% if theme_navbar_sidebarrel %}
3333
{% block sidebarrel %}
34+
<!-- comment out "prev" and "next" buttons -->
35+
<!--
3436
{% include "relations.html" %}
37+
-->
3538
{% endblock %}
3639
{% endif %}
3740
{% block navbarextra %}

doc/sphinx_bootstrap_theme/bootstrap/navbartoc.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<li class="dropdown">
2+
<!-- Comment out "Page" from navbar (we put contents on every page anyway) -->
3+
<!--
24
<a role="button"
35
id="dLabelLocalToc"
46
data-toggle="dropdown"
57
data-target="#"
68
href="#">{{ _(theme_navbar_pagenav_name) }} <b class="caret"></b></a>
9+
-->
710
<ul class="dropdown-menu localtoc"
811
role="menu"
912
aria-labelledby="dLabelLocalToc">{{ toc }}</ul>

doc/sphinx_bootstrap_theme/bootstrap/theme.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ navbar_fixed_top = true
4848

4949
# Location of link to source.
5050
# Options are "nav" (default), "footer" or anything else to exclude.
51-
source_link_position = nav
51+
source_link_position = footer
5252

5353
# Bootswatch (http://bootswatch.com/) theme.
5454
#

0 commit comments

Comments
 (0)