File tree 6 files changed +111
-14
lines changed
6 files changed +111
-14
lines changed Original file line number Diff line number Diff line change 53
53
html_theme = 'pandas_sphinx_theme'
54
54
html_logo = '_static/pandas.svg'
55
55
56
+ html_theme_options = {
57
+ "external_links" : [
58
+ {
59
+ 'url' : "https://pandas.pydata.org/pandas-docs/stable/" ,
60
+ "name" : "Pandas Docs"
61
+ }
62
+ ],
63
+ "github_url" : "https://github.com/pandas-dev/pandas-sphinx-theme" ,
64
+ "twitter_url" : "https://twitter.com/pandas_dev" ,
65
+ }
66
+
56
67
# Add any paths that contain custom static files (such as style sheets) here,
57
68
# relative to this directory. They are copied after the builtin static files,
58
69
# so a file named "default.css" will overwrite the builtin "default.css".
Original file line number Diff line number Diff line change 2
2
Configuration
3
3
*************
4
4
5
- TODO
5
+ There are a number of options for configuring your site's look and feel.
6
+ All configuration options are passed with the ``html_theme_options `` variable
7
+ in your ``conf.py `` file. This is a dictionary with ``key: val `` pairs that
8
+ you can configure in various ways. This page describes the options available to you.
9
+
10
+ Configure social media buttons
11
+ ==============================
12
+
13
+ If you'd like social media buttons to show up to the right of your nav bar, use the
14
+ following configuration:
15
+
16
+ .. code :: python
17
+
18
+ html_theme_options: {
19
+ " github_url" : " https://github.com/<your-org>/<your-repo>" ,
20
+ " twitter_url" : " https://twitter.com/<your-handle>" ,
21
+ }
22
+
23
+ Adding external links to your nav bar
24
+ =====================================
25
+
26
+ You can add external links to your navigation bar. These will show up to the right
27
+ of your site's main links, and will have a small icon indicating that they point to
28
+ an external site. You can add external links to the nav bar like so:
29
+
30
+ .. code :: python
31
+
32
+ html_theme_options: {
33
+ " external_links" : [
34
+ " https://<link-one>" ,
35
+ " https://<link-two>"
36
+ ]
37
+ }
38
+
39
+
40
+ Hiding the previous and next buttons
41
+ ====================================
42
+
43
+ By default, each page of your site will have "previous" and "next" buttons
44
+ at the bottom. You can hide these buttons with the following configuration:
45
+
46
+ .. code :: python
47
+
48
+ html_theme_options: {
49
+ " show_prev_next" : False
50
+ }
Original file line number Diff line number Diff line change 19
19
< a class ="nav-link " href ="{{ main_nav_item.url }} "> {{ main_nav_item.title }}</ a >
20
20
</ li >
21
21
{% endfor %}
22
- </ ul >
23
- < ul class ="navbar-nav ml-auto ">
24
- < li class ="nav-item ">
25
- < a class ="nav-link " href ="https://github.com/pandas-dev/pandas " target ="_blank " rel ="noopener ">
26
- < span > < i class ="fab fa-github-alt " style ="color:#333;font-size:1rem;line-height:1.25 "> </ i > </ span >
27
- </ a >
28
- </ li >
22
+ {% for external_link in theme_external_links %}
29
23
< li class ="nav-item ">
30
- < a class ="nav-link " href ="https://twitter.com/pandas_dev " target ="_blank " rel ="noopener ">
31
- < span > < i class ="fab fa-twitter " style ="color:#55acee;font-size:1rem;line-height:1.25 "> </ i > </ span >
32
- </ a >
24
+ < a class ="nav-link nav-external " href ="{{ external_link.url }} "> {{ external_link.name }}</ a >
33
25
</ li >
26
+ {% endfor %}
27
+ </ ul >
28
+ < ul class ="navbar-nav ml-auto ">
29
+ {% if theme_github_url | length > 2 %}
30
+ < li class ="nav-item ">
31
+ < a class ="nav-link " href ="{{ theme_github_url }} " target ="_blank " rel ="noopener ">
32
+ < span > < i class ="fab fa-github-square " style ="color:#333;font-size:1rem;line-height:1.25 "> </ i > </ span >
33
+ </ a >
34
+ </ li >
35
+ {% endif %}
36
+ {% if theme_twitter_url | length > 2 %}
37
+ < li class ="nav-item ">
38
+ < a class ="nav-link " href ="{{ theme_twitter_url }} " target ="_blank " rel ="noopener ">
39
+ < span > < i class ="fab fa-twitter-square " style ="color:#55acee;font-size:1rem;line-height:1.25 "> </ i > </ span >
40
+ </ a >
41
+ </ li >
42
+ {% endif %}
34
43
</ ul >
35
44
</ div >
Original file line number Diff line number Diff line change 13
13
14
14
{%- block css %}
15
15
< link rel ="stylesheet " href ="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css " integrity ="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T " crossorigin ="anonymous ">
16
- {{- css() }}
16
+ < link href ="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css " rel ="stylesheet " integrity ="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN " crossorigin ="anonymous ">
17
+
18
+ {{- css() }}
17
19
< link href ="{{ pathto('_static/css/custom.css', 1) }} " rel ="stylesheet ">
18
20
{%- endblock %}
19
21
58
60
< div >
59
61
{% block body %} {% endblock %}
60
62
</ div >
63
+ {% if theme_show_prev_next %}
61
64
< div class ='prev-next-bottom '>
62
65
{{ prev_next(prev, next) }}
63
66
</ div >
67
+ {% endif %}
64
68
</ main >
65
69
66
70
</ div >
Original file line number Diff line number Diff line change @@ -248,6 +248,13 @@ body {
248
248
border-style : none;
249
249
}
250
250
251
+ .nav-external : after {
252
+ font-family : 'FontAwesome' ;
253
+ font-size : 0.7rem ;
254
+ vertical-align : middle;
255
+ content : " \f08e" ;
256
+ }
257
+
251
258
252
259
/* Collapsing of the TOC sidebar while scrolling */
253
260
@@ -288,4 +295,21 @@ div.prev-next-bottom a.right-next {
288
295
289
296
div .prev-next-bottom a .right-next : after {
290
297
content : " >>"
291
- }
298
+ }
299
+
300
+ /* Social media buttons */
301
+
302
+ i .fab : before {
303
+ font-family : 'FontAwesome' ;
304
+ vertical-align : middle;
305
+ font-style : normal;
306
+ font-size : 1.5rem ;
307
+ }
308
+
309
+ i .fa-github-square : before {
310
+ content : "\f092" ;
311
+ }
312
+
313
+ i .fa-twitter-square : before {
314
+ content : "\f081" ;
315
+ }
Original file line number Diff line number Diff line change @@ -5,4 +5,8 @@ pygments_style = tango
5
5
6
6
[options]
7
7
sidebarwidth = 270
8
- sidebar_includehidden = True
8
+ sidebar_includehidden = True
9
+ external_links = []
10
+ github_url = ''
11
+ twitter_url = ''
12
+ show_prev_next = True
You can’t perform that action at this time.
0 commit comments