Commit 76713c3 1 parent eb52ac9 commit 76713c3 Copy full SHA for 76713c3
File tree 7 files changed +35
-4
lines changed
theme/pydata_sphinx_theme
7 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 174
174
# "primary_sidebar_end": ["custom-template.html", "sidebar-ethical-ads.html"],
175
175
# "article_footer_items": ["test.html", "test.html"],
176
176
# "content_footer_items": ["test.html", "test.html"],
177
- # "footer_start": ["test.html", "test.html"],
177
+ "footer_start" : ["copyright.html" ],
178
+ "footer_center" : ["sphinx-version.html" ],
178
179
# "secondary_sidebar_items": ["page-toc.html"], # Remove the source buttons
179
180
"switcher" : {
180
181
"json_url" : json_url ,
Original file line number Diff line number Diff line change @@ -488,9 +488,9 @@ Footer
488
488
Located in ``sections/footer.html ``.
489
489
490
490
The footer is just below a page's main content, and is configured in ``conf.py ``
491
- with ``html_theme_options['footer_start'] `` and ``html_theme_options['footer_end'] ``.
491
+ with ``html_theme_options['footer_start'] ``, `` html_theme_options['footer_center'] `` and ``html_theme_options['footer_end'] ``.
492
492
493
- By default, ``footer_end `` is empty, and ``footer_start `` has the following templates:
493
+ By default, ``footer_center `` is empty, and ``footer_start `` and `` footer_end `` have the following templates:
494
494
495
495
.. code-block :: python
496
496
Original file line number Diff line number Diff line change @@ -190,6 +190,7 @@ def update_and_remove_templates(
190
190
"theme_article_footer_items" ,
191
191
"theme_content_footer_items" ,
192
192
"theme_footer_start" ,
193
+ "theme_footer_center" ,
193
194
"theme_footer_end" ,
194
195
"theme_secondary_sidebar_items" ,
195
196
"theme_primary_sidebar_end" ,
Original file line number Diff line number Diff line change 10
10
}
11
11
12
12
.footer-items__start ,
13
+ .footer-items__center ,
13
14
.footer-items__end {
14
15
display : flex ;
15
16
flex-direction : column ;
16
17
gap : 0.5rem ;
17
18
justify-content : center ;
19
+ flex-grow : 1 ;
20
+ }
21
+
22
+ .footer-items__center {
23
+ text-align : center ;
18
24
}
19
25
20
26
.footer-items__end {
21
- margin-left : auto ;
22
27
text-align : end ;
23
28
}
24
29
Original file line number Diff line number Diff line change 7
7
{% endfor %}
8
8
</ div >
9
9
{% endif %}
10
+ {% if theme_footer_center %}
11
+ < div class ="footer-items__center ">
12
+ {% for item in theme_footer_center %}
13
+ < div class ="footer-item "> {% include item %}</ div >
14
+ {% endfor %}
15
+ </ div >
16
+ {% endif %}
10
17
{% if theme_footer_end %}
11
18
< div class ="footer-items__end ">
12
19
{% for item in theme_footer_end %}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ article_footer_items =
47
47
content_footer_items =
48
48
primary_sidebar_end = sidebar-ethical-ads.html
49
49
footer_start = copyright.html, sphinx-version.html
50
+ footer_center =
50
51
footer_end = theme-version.html
51
52
secondary_sidebar_items = page-toc.html, edit-this-page.html, sourcelink.html
52
53
show_version_warning_banner = False
Original file line number Diff line number Diff line change @@ -418,6 +418,22 @@ def test_included_toc(sphinx_build_factory) -> None:
418
418
assert included_page_html is not None
419
419
420
420
421
+ def test_footer (sphinx_build_factory ) -> None :
422
+ """Test for expected footer contents."""
423
+ overrides = {
424
+ "html_theme_options.footer_start" : ["copyright.html" ],
425
+ "html_theme_options.footer_center" : ["sphinx-version.html" ],
426
+ }
427
+ sphinx_build = sphinx_build_factory ("base" , confoverrides = overrides ).build ()
428
+ index_html = sphinx_build .html_tree ("index.html" )
429
+ footer_sta = index_html .select ("div.footer-items__start" )[0 ]
430
+ footer_ctr = index_html .select ("div.footer-items__center" )[0 ]
431
+ footer_end = index_html .select ("div.footer-items__end" )[0 ]
432
+ assert "Pydata community" in footer_sta .text
433
+ assert "Created using" in footer_ctr .text
434
+ assert "Built with the" in footer_end .text
435
+
436
+
421
437
# html contexts for `show_edit_button`
422
438
423
439
# these are "good" context fragments that should yield a working link
You can’t perform that action at this time.
0 commit comments