opened
willvieira
username_0
Hi Dean, I would like to know how you made your navbar shorter as your "shiny.html" in your personal website. I tried to figure out myself but couldn't find a way.
If it's simple, I think it would be nice to have the "nav-short: true" option available in this template.
Thanks for the share this project!
[question] nav-short: true
issue
created
daattali
username_1
Looking at the code, I see that I added a CSS class when `nav-short` is true: https://github.com/username_1/username_1.github.io/blob/000afefb20c1d91fb926682b9480efd32c87743c/_includes/nav.html#L1

And it looks like I added the corresponding CSS here https://github.com/username_1/username_1.github.io/blob/b2f6605c58872830b2e24691b382a08f76145d5c/css/main.css#L121

You can try that. I don't remember if I did anything else :)  You can also look in the commits around that time and see if I did anything else.

If you want to add this as an option in my template, I'd happily accept a PR!
comment
created
willvieira
username_0
Great, just with these two changes it worked!

However the title still in the same position which makes a big distance between the nav and the title: 
<img width="1437" alt="captura de tela 2017-02-21 as 13 57 29" src="https://cloud.githubusercontent.com/assets/20832638/23180016/f133ab3e-f83d-11e6-9c7d-bef5826ecbf2.png">

I saw you added this code in your shiny.html:
```
<style>
  footer {
    margin-top: -10px;
  }
  #shiny-server-iframe {
    margin-top: 51px;
    border: 0 none;
  }
</style>
```
however it didn't work for me and the distance still big. Do you think it's easy to fix?
Further, if we want to add this as an option in your template, it would have be insert somewhere with a `if` if short-nav is `TRUE`
comment
created
daattali
username_1
the if statement you are talking about is line 1 of nav.html (the first link from my previous comment)

Based on the css code you just showed me, it looks like I hardcoded the whitespace to a specific value only for the shiny page (which is of course a terrible thing to do and I might go to hell for hardcoding it). You'd have to make the spacing work by inspecting the HTML and playing around with the css, sorry!
comment
created
willvieira
username_0
I finally got to adjust that distance by adding the fallow code after the line 57 of the `header.html`:
```
<style>
    h2 {
    margin-top: -60px;
    }
</style>
```
However, this change will apply for all pages with a `layout: page` so I was wondering if we could add an `if` statement like `if nav-short: true` before this?
I guess this is a really simple thing to do but I have no knowledge in coding html.
Anyway, if you know how to do it in simple way I can add this option as a PR otherwise you can close the issue. 
Thanks for the help!
comment
created
daattali
username_1
Glad you got it working. A few other changes will have to be made to support that option. I'm closing this issue, if other people ask for this in the future then I'll take a look at adding it
comment
closed
daattali
username_1
issue