{% assign lang = site.active_lang %}
<div class="sidebar">
  <div class="container sidebar-sticky">
    <div class="sidebar-about">
      <p class="speech">{{ site.hello[site.active_lang]}}</p>
    </br>
      <h1>
        <a href="{{ site.baseurl }}">
          {{ site.title }}
        </a>
      </h1>
      <p class="lead">{{ site.description[lang] }}</p>
    </div>

    <nav class="sidebar-nav">
      <a class="sidebar-nav-item{% if page.url == site.baseurl %} active{% endif %}" href="{{ site.baseurl }}/">Home</a>

      {% assign pages_list = site.pages %}
      {% assign written = "" | split: '' %}
      {% for node in pages_list %}
        {% if written contains node.title %}
          {% continue %}
        {% endif %}
        {% if node.title != null %}
          {% if node.layout == "page" %}
            <a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{site.baseurl}}{{ node.url }}">{{ node.title }}</a>
          {% endif %}
          {% assign written = written | push: node.title %}
        {% endif %}
      {% endfor %}
      <a class="sidebar-nav-item{% if page.url == node.url %} active{% endif %}" href="{{ node.url }}">{{ node.title }}</a>

      <a class="sidebar-nav-item" href="https://rubygems.org/gems/jekyll-polyglot">Ruby Gem</a>
      <a class="sidebar-nav-item" href="{{ site.github.repo }}">GitHub project</a>
      <a class="sidebar-nav-item" href="{{ site.github.repo }}/tree/master/site/{{ page.path }}"><small>view this page source on github</small></a>
      <small class="sidebar-nav-item">Currently v{{ site.version }}</small>
    </nav>

    <p><small>&copy; {{ site.time | date: '%Y' }} Samuel Volin</small><br/><small>MIT Licensed</small></p>
<p>
  <!-- jekyll-polyglot will process ferh= into href= through the static_href liquid block tag without relativizing the url; useful for making language navigation switchers  -->
  {% for tongue in site.languages %}
<a {% if tongue == site.active_lang %}style="font-weight: bold;"{% endif %} {% static_href %}href="{% if tongue == site.default_lang %}{{site.baseurl}}{{page.url}}{% else %}{{site.baseurl}}/{{ tongue }}{{page.url}}{% endif %}"{% endstatic_href %} >{{ tongue }}</a> |
  {% endfor %}
</p>
  </div>
</div>
