@@ -19,7 +19,7 @@ doc path's _static folder, and use the following configuration:
19
19
20
20
html_logo = " _static/logo.png"
21
21
22
- The logo links to ``master_doc `` (usually the first page of your documentation) by default.
22
+ The logo links to ``master_doc `` (usually the first page of your documentation) by default.
23
23
If you'd like it to link to another page or use an external link instead, use the following configuration:
24
24
25
25
.. code :: python
@@ -29,20 +29,80 @@ If you'd like it to link to another page or use an external link instead, use th
29
29
}
30
30
31
31
32
- Configure social media buttons
33
- ==============================
32
+ Configure icon links
33
+ ====================
34
34
35
- If you'd like social media buttons to show up to the right of your nav bar, use the
35
+ If you'd like icon links to show up to the right of your main navigation bar, use the
36
36
following configuration:
37
37
38
38
.. code :: python
39
39
40
40
html_theme_options = {
41
- " github_url" : " https://github.com/<your-org>/<your-repo>" ,
42
- " gitlab_url" : " https://gitlab.com/<your-org>/<your-repo>" ,
43
- " twitter_url" : " https://twitter.com/<your-handle>" ,
41
+ ...
42
+ " icon_links" : [
43
+ {
44
+ " name" : " GitHub" ,
45
+ " url" : " https://github.com/<your-org>/<your-repo>" ,
46
+ " icon" : " fab fa-github-square" ,
47
+ },
48
+ {
49
+ " name" : " GitLab" ,
50
+ " url" : " https://gitlab.com/<your-org>/<your-repo>" ,
51
+ " icon" : " fab fa-gitlab" ,
52
+ },
53
+ {
54
+ " name" : " Twitter" ,
55
+ " url" : " https://twitter.com/<your-handle>" ,
56
+ " icon" : " fab fa-twitter-square" ,
57
+ },
58
+ ],
59
+ ...
60
+ }
61
+
62
+
63
+ The value of ``icon `` can be any full
64
+ `FontAwesome 5 Free <https://fontawesome.com/icons?d=gallery&m=free >`__ icon.
65
+ In addition to the main icon class, e.g. ``fa-cat ``, the "style" class must
66
+ also be provided e.g. `fab ` for *branding *, or `fas ` for *solid *.
67
+
68
+
69
+ .. Hint ::
70
+
71
+ To get custom colors like "Twitter blue", use the following in your CSS,
72
+ e.g. ``custom.css ``:
73
+
74
+ .. code :: css
75
+
76
+ i .fa-twitter-square :before {
77
+ color : #55acee ;
78
+ }
79
+
80
+ This has already been added for the brands that have *shortcuts *.
81
+
82
+ The below are shortcuts for commonly-used services, but may be removed in a future
83
+ release in favor of ``icon_links ``:
84
+
85
+ .. code :: python
86
+
87
+ html_theme_options = {
88
+ ...
89
+ " github_url" : " https://github.com/<your-org>/<your-repo>" ,
90
+ " gitlab_url" : " https://gitlab.com/<your-org>/<your-repo>" ,
91
+ " twitter_url" : " https://twitter.com/<your-handle>" ,
92
+ ...
44
93
}
45
94
95
+ Additionally, the screen-reader accessible label for this menu can be configured:
96
+
97
+ .. code :: python
98
+
99
+ html_theme_options = {
100
+ ...
101
+ " icon_links_label" : " Quick Links" ,
102
+ ...
103
+ }
104
+
105
+
46
106
Adding external links to your nav bar
47
107
=====================================
48
108
0 commit comments