pydata-sphinx-theme icon indicating copy to clipboard operation
pydata-sphinx-theme copied to clipboard

NEW: Adding a section for footer-content like in sphinx-basic-ng

Open AakashGfude opened this issue 3 years ago • 4 comments

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.). slack-imgs

The specific tags created/reordered here are:

  • bd-container__inner now has a new main tag and primary sidebar as its only children. secondary sidebar has been moved from this position.
  • new main tag is introduced to accommodate footer-content section. The visual position of which is shown in the pic above.
  • main tag has bd-content and the new footer-section as its children tags.
  • bd-content now has bd-article-container and 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-container has 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 avatar Aug 08 '22 12:08 AakashGfude

@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: image

choldgraf avatar Aug 09 '22 08:08 choldgraf

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:

Screen Shot 2022-08-09 at 10 43 17 pm

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.

AakashGfude avatar Aug 09 '22 12:08 AakashGfude

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

choldgraf avatar Aug 10 '22 13:08 choldgraf

Good idea @choldgraf, have added the section for footer content.

Screen Shot 2022-08-11 at 11 47 03 am

AakashGfude avatar Aug 11 '22 02:08 AakashGfude

@choldgraf let me know how it looks now.

AakashGfude avatar Aug 15 '22 03:08 AakashGfude

@choldgraf I don't have the permission to merge here. Do merge if you think it looks okay.

AakashGfude avatar Aug 16 '22 09:08 AakashGfude

Thanks for the enhancement @AakashGfude !

choldgraf avatar Aug 18 '22 07:08 choldgraf