Skip to content

Commit 242d9d3

Browse files
committed
Move search box more at the top
This makes it easier for users as if the TOC is long, the search box isn't visible anymore.
1 parent 87f639f commit 242d9d3

File tree

4 files changed

+21
-43
lines changed

4 files changed

+21
-43
lines changed

changelog.d/pr436.doc.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Move search box more at the top. This makes it easier for
2+
users as if the TOC is long, the search box isn't visible
3+
anymore.

docs/_static/css/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ div.related.top nav {
3131
margin-bottom: -0.75em;
3232
}
3333

34+
#searchbox {
35+
margin-bottom: 1.25em;
36+
}
37+
3438
.section h1 {
3539
font-weight: 700;
3640
}

docs/_templates/layout.html

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,8 @@
33
#}
44
{% extends "!layout.html" %}
55

6-
{%- block footer %}
7-
<div class="footer">
8-
<p>
9-
{% if show_copyright %}&copy;{{ copyright }}.{% endif %}
10-
{% if theme_show_powered_by|lower == 'true' %}
11-
{% if show_copyright %}|{% endif %}
12-
{% if show_copyright %}|{% endif %}
13-
Powered by <a href="http://sphinx-doc.org/">Sphinx {{ sphinx_version }}</a>
14-
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster {{ alabaster_version }}</a>
15-
{% endif %}
16-
{%- if show_source and has_source and sourcename %}
17-
{% if show_copyright or theme_show_powered_by %}|{% endif %}
18-
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
19-
rel="nofollow">{{ _('Page source') }}</a>
20-
{%- endif %}
21-
</p>
22-
<p>
23-
For <a href="https://github.com/{{ theme_github_user }}/{{ theme_github_repo }}"
24-
>semver {{ version }}</a>
25-
</p>
26-
</div>
276

28-
{% if theme_github_banner|lower != 'false' %}
29-
<a href="https://github.com/{{ theme_github_user }}/{{ theme_github_repo }}" class="github">
30-
<img style="position: absolute; top: 0; right: 0; border: 0;" src="{{ pathto('_static/' ~ theme_github_banner, 1) if theme_github_banner|lower != 'true' else 'https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png' }}" alt="Fork me on GitHub" class="github"/>
31-
</a>
32-
{% endif %}
33-
{% if theme_analytics_id %}
34-
<script type="text/javascript">
35-
36-
var _gaq = _gaq || [];
37-
_gaq.push(['_setAccount', '{{ theme_analytics_id }}']);
38-
_gaq.push(['_setDomainName', 'none']);
39-
_gaq.push(['_setAllowLinker', true]);
40-
_gaq.push(['_trackPageview']);
41-
42-
(function() {
43-
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
44-
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
45-
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
46-
})();
47-
</script>
48-
{% endif %}
49-
{%- endblock %}
7+
{%- block extrahead %}
8+
{{- super() }}
9+
<meta name="generator" content="Toms"/>
10+
{% endblock %}

docs/conf.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,16 @@ def find_version(*file_paths):
211211
html_static_path = ["_static"]
212212
html_css_files = ["css/custom.css"]
213213

214+
html_sidebars = {
215+
"**": [
216+
"about.html", # theme_logo
217+
# 'relations.html', # prev and next
218+
"searchbox.html", # basic/searchbox.html
219+
"navigation.html", # TOC
220+
# 'donate.html',
221+
]
222+
}
223+
214224
# Canonical link relation
215225
if os.environ.get("READTHEDOCS_CANONICAL_URL"):
216226
html_baseurl = f"{os.environ['READTHEDOCS_CANONICAL_URL']}"

0 commit comments

Comments
 (0)