Skip to content

Fix navbar alignment by adding navbar_align configuration to PyData Sphinx Theme#162

Open
bhanushaliparthhitesh wants to merge 3 commits intoneuroinformatics-unit:mainfrom
bhanushaliparthhitesh:main
Open

Fix navbar alignment by adding navbar_align configuration to PyData Sphinx Theme#162
bhanushaliparthhitesh wants to merge 3 commits intoneuroinformatics-unit:mainfrom
bhanushaliparthhitesh:main

Conversation

@bhanushaliparthhitesh
Copy link

@bhanushaliparthhitesh bhanushaliparthhitesh commented Jan 29, 2026

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

The navigation links in the documentation were centred by default, . This PR fixes the alignment issue by configuring the navbar to be left-aligned.

What does this PR do?

This PR adds the navbar_align: "left" configuration option to the PyData Sphinx Theme settings in docs/source/conf.py. This ensures that navigation links are left-aligned instead of centered, providing better visual consistency with the overall documentation layout.

References

Fixes : #224

How has this PR been tested?

  • Built the documentation locally using Sphinx
  • Verified that the navigation links now appear left-aligned in the rendered HTML output
  • Confirmed that no other functionality or styling has been affected

Is this a breaking change?

No, this is not a breaking change. This is a purely visual/styling update that does not affect any existing functionality or APIs.

Does this PR require an update to the documentation?

No documentation updates are required. This change only affects the visual presentation of the existing documentation, not its content or structure.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (N/A for configuration changes)
  • The documentation has been updated to reflect any changes (N/A - visual change only)
  • The code has been formatted with pre-commit
    Before:
image image

After :
image
image

The images show the "before" and "after" states of the neuroinformatics-unit.github.io website. Although the changes originated there, they have been migrated to the python-cookiecutter repository. This allows for the implementation of these changes across the 10+ neuroinformatics websites.

Signed-off-by: parth <parth.bhanushali241@sakec.ac.in>
@adamltyson
Copy link
Member

Hi @bhanushaliparthhitesh, thanks for this. This repo is a template though, so the changes also need to be made inside {{cookiecutter.package_name}}.

Signed-off-by: parth <parth.bhanushali241@sakec.ac.in>
@bhanushaliparthhitesh
Copy link
Author

bhanushaliparthhitesh commented Jan 29, 2026

@adamltyson I've made the necessary changes within the {{cookiecutter.package_name}} folder. Could you provide some guidance on the expected footer changes?

@adamltyson
Copy link
Member

hi @bhanushaliparthhitesh, there are changes to conf.py and also the CSS at the top of the repo, but only in conf.py within the cookiecutter package. Should they both have adjustments made to the CSS?

@bhanushaliparthhitesh
Copy link
Author

Hi @adamltyson, apologies, I'm not understanding your question. If you're asking if both conf.py and custom.css should have changes, then yes, because the default navigation bar position is centered.

@adamltyson
Copy link
Member

This repo has two sets of website config. One is for the website about the repo, which is at the top level. You've made changes to both conf.py and the CSS here (all good). However, this repo is a template for other repos (inside the {{cookiecutter.package_name}}). the same changes need to be made here, but you've only changed the conf.py file, but not added a CSS file.

Signed-off-by: parth <parth.bhanushali241@sakec.ac.in>
@bhanushaliparthhitesh
Copy link
Author

@adamltyson, thanks for the clarification – that really helped! I understand now that the repo has two website configurations: one at the top level and one within the {{cookiecutter.package_name}} template. I had already updated both conf.py and the CSS at the top level, but initially only updated conf.py inside the cookiecutter template. I've now made the necessary changes and added the corresponding CSS adjustments within the cookiecutter template as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend Feature Enhancements

2 participants