Skip to content
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

The content of "navbar-center" appears directly after the logo #1235

Closed
positr0nium opened this issue Mar 7, 2023 · 4 comments · Fixed by #1331
Closed

The content of "navbar-center" appears directly after the logo #1235

positr0nium opened this issue Mar 7, 2023 · 4 comments · Fixed by #1331

Comments

@positr0nium
Copy link

My options are
html_theme_options = { "collapse_navigation": True, "navigation_depth": 4, "show_prev_next": False, "navbar_start": ["navbar-logo"], "navbar_center": ["navbar-nav"], "navbar_end": [], "enable_search_shortcuts" : True, "search_bar_text": "Search the docs... ", "navbar_align": "content", "pygment_light_style": "lovelace", }

With 0.13.0 this gives me
pydata_sphinx_bug_report

The exact same config for 0.12.0 gives me
pydata_sphinx_bug_report_2

@FranzRoters
Copy link

I encounter the exact same problem.

The generated html code changed from 012.0:

<div class="col-lg-9 navbar-header-items">
    <div id="navbar-center" class="mr-auto">
      
      <div class="navbar-center-item">
        <nav class="navbar-nav">

to 0.13.0:

<div class="col-lg-9 navbar-header-items">
    
    <div class="me-auto navbar-header-items__center">
      
        <div class="navbar-item"><nav class="navbar-nav">

In 0.13.0 "navbar_align": "left" results in the same html without the col-lg-9.

@vkbo
Copy link
Contributor

vkbo commented Mar 10, 2023

I've noticed the same. "navbar_align": "left" and "navbar_align": "content" produce the same result.

@FranzRoters
Copy link

FranzRoters commented Mar 10, 2023

What seems to be needed is the following:

Instead of adding col-lg-9 to navbar-header-items, as shown in my comment above, col-lg-3 should be added to <div class="navbar-header-items__start"> .

When I edit my html-file by hand the result is as expected for "navbar_align": "content".

You can achieve this automatically using custom.js:

$(document).ready(function () {
   var fixalign = document.getElementsByClassName("navbar-header-items__start")
   fixalign[0].classList.add("col-lg-3");
});

@sblauth
Copy link
Contributor

sblauth commented Mar 14, 2023

For me, all versions of navbar_align, produce the same result - a navbar, that is aligned to the left. So also "navbar_align": "right" produces the same result as "navbar_align": "content" and "navbar_align": "left".

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 a pull request may close this issue.

4 participants