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

Optional side nav #68

Open
mrchief opened this issue Mar 7, 2016 · 0 comments
Open

Optional side nav #68

mrchief opened this issue Mar 7, 2016 · 0 comments

Comments

@mrchief
Copy link

mrchief commented Mar 7, 2016

Some of my pages have a side nav (not all, just a few). I'm using bootstrap and I was wondering how I could add proper classes when the sidenav file is present.

So when sidenav is present:

---col-3--- | ---col-9---
sideNav     | page content

when not:

---col-12---
page content

My first shot was to do something in layout.jade but I cannot figure out how to check if the sideNav file is present or not in a simple way.

Here's roughly what I'd like to do in _layout.jade:

div.content-wrapper
    if(current folder has a _sideNav.jade)
        .sidebar-wrapper
            != partial(current.path.join('/') + '/_sideNav')

        article.main-container
            != yield
    else
        article.main-container
            != yield

Is this doable? Or is there a better way to handle this?

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

No branches or pull requests

1 participant