Skip to content

Article content is no longer centered when no sidebars are present #1691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andykee opened this issue Jan 30, 2024 · 4 comments · Fixed by #1688
Closed

Article content is no longer centered when no sidebars are present #1691

andykee opened this issue Jan 30, 2024 · 4 comments · Fixed by #1688
Labels
kind: bug Something isn't working

Comments

@andykee
Copy link

andykee commented Jan 30, 2024

According to the docs, article_content should be centered when neither sidebar is present. This was the case prior to v0.15.* (screenshot below, built with v0.14.4):

Screenshot 2024-01-29 at 9 33 27 PM

This is no longer true as of v0.15.0rc0 - the content now seems to float left (screenshot below, same source as above rebuilt with v0.15.0rc0):

Screenshot 2024-01-29 at 9 34 26 PM

This behavior is still present in the latest release (v0.15.2)

@Charlie-XIAO
Copy link
Contributor

Not sure but I think this may be the same problem as #1686? If you are removing the secondary sidebar my using secondary_sidebar_items as a dict in conf.py and setting the corresponding page to an empty list then I think it is the same issue. If you inspect the page I think you may find that the secondary sidebar div is still there, though empty.

@andykee
Copy link
Author

andykee commented Jan 30, 2024

It may be related, but is not identical to #1686. My conf.py doesn't define secondary_sidebar_items, although you are right that when I inspect the rendered page source, an empty div with class .bd-sidebar-secondary is there. Interestingly, on pages with a primary sidebar (.bd-sidebar-primary), the secondary sidebar isn't present.

@Charlie-XIAO
Copy link
Contributor

Charlie-XIAO commented Jan 30, 2024

Ah I see. So the reason is that secondary_sidebar_items is by default page-toc, edit-this-page, sourcelink if you just leave it as is, and that's why the secondary sidebar is showing up. Not the same cause as my issue, but I think #1688 is going to solve your problem as well. I may see if I can extend the tests in #1688 to cover your case. It would be nice if you can also try out the changes in #1688 to confirm if your issue gets resolved.

Interestingly, on pages with a primary sidebar (.bd-sidebar-primary), the secondary sidebar isn't present.

That's strange... I built your site locally, but .bd-sidebar-secondary exists regardless of the primary sidebar. For instance, it exists on the user guide page.

@andykee
Copy link
Author

andykee commented Jan 31, 2024

That's strange... I built your site locally, but .bd-sidebar-secondary exists regardless of the primary sidebar. For instance, it exists on the user guide page.

Apologies, I must not have dug down far enough into the source tree. You're right, .bd-sidebar-secondary always seems to be there...

I updated my original comment to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants