<div id="sidebar" class="sidebar">
	
	{% assign sorted_nav = site.data.nav.toc | sort: "position" %}
	{% for nav in sorted_nav %}
		{% assign col = site.collections | where:"id", nav.collection | first %}
    <section class="pnl-main-nav-section main-nav-section" url="{{ nav.url | relative_url }}">
		<h6 class="ctrl-nav-section title">{{ nav.title }}</h6>
		<ul class="cont-nav-section content">
			{% if nav.docs %}
				{% for doc in nav.docs | sort: "position" %}
					{% if doc.collection %}
						<li><a href="{{ nav.url | relative_url }}#{{ doc.collection | slugify }}">{{ doc.title }}</a></li>
					{% elsif doc.url %}
						<li><a href="{{ nav.url | relative_url }}{{ doc.url }}">{{ doc.title }}</a></li>
					{% endif %}
				{% endfor %}
			{% else %}
				{% if col %}
					{% assign sorted_docs = col.docs | sort: "position" %}
					{% for doc in sorted_docs %}
						{% unless doc.exclude_nav %}
						<li><a href="{{ nav.url | relative_url }}#{{ doc.id | slugify }}">{{ doc.title }}</a></li>
						{% endunless %}
					{% endfor %}
				{% endif %}
			{% endif %}
		</ul>
	</section>
	{% endfor %}
</div>
