I started with the following code, that should generate the navigation bar of my site using Jekyll (and bootstrap):
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#jb-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{ HOME_PATH }}">{{ site.title }}</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="jb-navbar-collapse">
<ul class="nav navbar-nav">
{% assign pages_list = site.pages %}
{% assign group = 'navigation' %}
{% include JB/pages_list %}
</ul>
</div><!-- /.navbar-collapse -->
</nav>
However, I want to have a logo in front of {{ site .title }}
. To that end, I tried to use the following code:
<nav class="navbar navbar-default" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#jb-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<div style="text-align:left">
<a href="{{ HOME_PATH }}"><img src="{{ site.logoimg }}" height="5%" width="5%"/></a>
<a class="navbar-brand" href="{{ HOME_PATH }}">{{ site.title }}</a>
</div>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="jb-navbar-collapse">
<ul class="nav navbar-nav">
{% assign pages_list = site.pages %}
{% assign group = 'navigation' %}
{% include JB/pages_list %}
</ul>
</div><!-- /.navbar-collapse -->
</nav>
The problems are:
- The logo is to the right of the text
- Now there's a huge horizontal space between the text+logo and the pages' names.
I guess it is something simple, but I don't know how to tackle it. How can I place the logo to the left of the text and avoid the bad h-spacing. A bonus would be to make sure that the line of text is v-centered with respect to the logo.