Skip to content
Discussion options

You must be logged in to vote

Okay I got my own behavior working, it'd be kinda nice if this could somehow be used in quarto main, but for now I'll use this for my website and inject a directive for doing so or a flag in the project as I build.

In hide_sidebar.js:

var children = $(".sidebar-menu-container > .list-unstyled").children()
var url = window.location.pathname
for (var child of children){
    var active_sidebar = $(child).find(`a[href*="${url}"]`)[0]
    console.log(active_sidebar)
    if (active_sidebar !== undefined){
        $(active_sidebar).parent().parent().wrap("<div id='active-sidebar'></div>")
    }
    else {
        child.style.display = "none"
    }
}

The _quarto.yml:

website:
  sidebar:
    search: 

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
1 reply
@muellerzr
Comment options

Comment options

You must be logged in to vote
6 replies
@mcanouil
Comment options

mcanouil Jun 8, 2023
Collaborator

@muellerzr
Comment options

@muellerzr
Comment options

@mcanouil
Comment options

mcanouil Jun 8, 2023
Collaborator

@muellerzr
Comment options

Comment options

You must be logged in to vote
2 replies
@muellerzr
Comment options

@muellerzr
Comment options

Answer selected by muellerzr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
websites Issues creating websites
2 participants