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

Wrong tab indicate as active in navbar #11481

Open
ecomodeller opened this issue Nov 19, 2024 · 3 comments
Open

Wrong tab indicate as active in navbar #11481

ecomodeller opened this issue Nov 19, 2024 · 3 comments
Labels
bug Something isn't working website-navigation websites Issues creating websites

Comments

@ecomodeller
Copy link

Bug description

Top navigation adds an .active class to the current page. This feature is broken in some cases, e.g. when a sidebar is used in addition to a top navbar.

This was previously discussed in #1321

Steps to reproduce

Example of problematic quarto project
Image

Contents of _quarto.yml:

project:
  type: website

website:
  title: "Navigation tabs"
  search: true
  sidebar:
    style: docked
    contents:
      - href: index.qmd
        text: Home
      - href: getting_started.qmd
  navbar:
    left:
      - href: index.qmd
        text: Home
      - href: getting_started.qmd
        text: "Getting Started"
      - about.qmd

format:
  html:
    theme: journal
    css: styles.css
    toc: true

Expected behavior

The current page should be indicated as active in the navbar.

If there is no link in the navbar, no link should be marked as active.

Actual behavior

The wrong link is marked as active.

Your environment

  • IDE: VSCode
  • OS: Linux Ubuntu 24.04

Quarto check output

quarto check

Quarto 1.5.55
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.5.55
Path: /opt/quarto/bin

[✓] Checking tools....................OK
TinyTeX: v2024.11
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /home/jan/.TinyTeX/bin/x86_64-linux
Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.12.7
Path: /home/jan/.local/bin/python3
Jupyter: 5.7.2
Kernels: julia-1.10, julia-nodeps-1.10, python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
Version: 4.1.2
Path: /usr/lib/R
LibPaths:
- /home/jan/R/x86_64-pc-linux-gnu-library/4.1
- /usr/local/lib/R/site-library
- /usr/lib/R/site-library
- /usr/lib/R/library
knitr: 1.45
rmarkdown: 2.25

[✓] Checking Knitr engine render......OK

@ecomodeller ecomodeller added the bug Something isn't working label Nov 19, 2024
@mcanouil
Copy link
Collaborator

Could you share a Git repository rather than a ZIP archive?

@mcanouil mcanouil added the websites Issues creating websites label Nov 19, 2024
@ecomodeller
Copy link
Author

Could you share a Git repository rather than a ZIP archive?

Git repository
Rendered site

@mcanouil
Copy link
Collaborator

Thanks, I can reproduce.

I think it has to do with how hybrid navigation works. https://quarto.org/docs/websites/website-navigation.html#hybrid-navigation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working website-navigation websites Issues creating websites
Projects
None yet
Development

No branches or pull requests

2 participants