pydata-sphinx-theme
pydata-sphinx-theme copied to clipboard
NEW: Adding a section for footer-content like in sphinx-basic-ng
Added footer-content.html, following the sphinx-basic-ng design.
For this and to mimic sphinx-basic-ng design (which we are ultimately planning to inherit) https://github.com/pydata/pydata-sphinx-theme/pull/840, have reordered and created a few tags for body content. Copied over the container CSS for these elements as well from sphinx-basic-ng, including the page width to be 88rem (which looked nicer to me, but can revert it.).

The specific tags created/reordered here are:
bd-container__innernow has a newmaintag and primary sidebar as its only children. secondary sidebar has been moved from this position.- new
maintag is introduced to accommodate footer-content section. The visual position of which is shown in the pic above. maintag hasbd-contentand the new footer-section as its children tags.bd-contentnow hasbd-article-containerand the secondary sidebar as its children. Note that the secondary sidebar was earlier on the same level as primary sidebar, but has moved here to adhere to the skeleton of sphinx-basic-ng.bd-article-containerhas an article header, article content, and article footer in it.
Inspecting the HTML, in the preview of this PR will help understand the hierarchy better.
The need for this section was highlighted in a PR in sphinx-book-theme: https://github.com/executablebooks/sphinx-book-theme/pull/597
@AakashGfude this looks good in general to me, though I'm a bit surprised at how many changed lines of code there are. Are those just rearrangements? Could you please:
- In the top description, could you be more specific than just "reordered and created a few body tags"? What did you rearrange specifically? In particular anything that might be a breaking change for downstream CSS
- Does this change the end output at all? I couldn't see any difference in our site.
- Doesn't the theme already have a footer that spans the entire bottom of the page? How is this different from that? e.g. from our main docs:

Thanks, @choldgraf, have updated the top description to explain the HTML container structure better. It does not change the output at all of this theme, because we don't use footer-content at all here (Which is introduced in this PR). However, I have made the page-width to be 88rem (same as sphinx-basic-ng), while I was adjusting the styles to the new HTML layout.
The screenshot which you have posted is of footer.html which is in bright red in the snapshot of sections in the top description. And it spans the whole page.
The one introduced here is footer-content, which spans the article plus the sidebar-secondary width. The need for this section arises in sphinx-book-theme . Notice the footer in the image below:
It will not break any downstream CSS, as the hierarchy has been matched in the SCSS files, but I will keep looking tomorrow for any unintended changes.
A quick thought - could you update our layout figure at the link below to include this?
- https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/layout.html
This will also make it easier to figure out what exactly we are adding
Good idea @choldgraf, have added the section for footer content.
@choldgraf let me know how it looks now.
@choldgraf I don't have the permission to merge here. Do merge if you think it looks okay.
Thanks for the enhancement @AakashGfude !