<div class="sidebar-content">
  <div class="logo">
    <span class="icon">
      <img src="{{ site.url | append: site.baseurl }}/assets/bolt-py-logo.svg"/>
    </span>

    <span class="name">
      Bolt
    </span>

    <!-- Liquid has no ternary operator, so this is just meant to disclude 
      english sections since they are at the root URL -->
    {% assign localized_base_url = page.lang | prepend: "/" | remove_first: "/en" %}

    <span class="version">
        {% assign release = site.github.releases | sort: "created_at" | reverse | pop %}
        <a href="{{ release[0].html_url }}">{{ release[0].tag_name }}</a>
    </span>
  </div>

  <ul class="sidebar-section">
    <a href="{{ site.url | append: site.baseurl | append: localized_base_url  }}/tutorial/getting-started"><li class="title">{{ site.t[page.lang].start }}</li></a>
  </ul>

  <ul class="sidebar-section">
    <a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#basic"><li class="title">{{ site.t[page.lang].basic }}</li></a>
    {% assign basic_sections = site.basic | sort: "order" | where: "lang", page.lang %}
    
    {% for section in basic_sections %}
      <a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#{{ section.slug }}">
        <li>{{section.title}}</li>
      </a>
    {% endfor %}
  </ul>

  <ul class="sidebar-section">
    <a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#advanced">
      <li class="title">{{ site.t[page.lang].advanced }}</li>
    </a>
    {% assign advanced_sections = site.advanced | sort: "order" | where: "lang", page.lang %}
    {% for section in advanced_sections %}
      <a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/concepts#{{ section.slug }}">
        <li>{{section.title}}</li>
      </a>
    {% endfor %}
  </ul>

  <ul class="sidebar-section">
    {% assign tutorials = site.tutorials | where: "lang", page.lang | where_exp: "tutorial", "tutorial.order > 0" %}
    {% for tutorial in tutorials %}
      <a href="{{ site.url | append: site.baseurl | append: localized_base_url }}/tutorial/{{ tutorial.slug }}">
        <li class="title">{{tutorial.title}}</li>
      </a>
    {% endfor %}
    <a href="https://github.com/SlackAPI/bolt-python/blob/master/.github/contributing.md"><li class="title">{{ site.t[page.lang].contribute }}</li></a>
  </ul>
</div>
