{{- $currentUrl := .RelPermalink }}
{{- $docs       := where .Site.Pages "Section" "docs" }}
<div class="dropdown">
  <div class="dropdown-trigger">
    <button class="button is-dark" aria-haspopup="true" aria-controls="docs-dropdown-menu">
      <span>Docs</span>
      <span class="icon is-small">
        <i class="fas fa-angle-down" aria-hidden="true"></i>
      </span>
    </button>
  </div>
  <div class="dropdown-menu" id="docs-dropdown-menu" role="menu">
    <div class="dropdown-content">
      {{- range $docs }}
      {{- $isCurrentPage := eq $currentUrl .RelPermalink }}
      <a class="dropdown-item{{ if $isCurrentPage }} is-active{{ end }}" href="{{ .RelPermalink }}">
        {{ .Title }}
      </a>
      {{- end }}
    </div>
  </div>
</div>

{{- if .TableOfContents }}
<div class="dropdown">
  <div class="drodown-trigger">
    <button class="button is-light">
      <span>
        Contents
      </span>
      <span class="icon is-small">
        <i class="fas fa-angle-down" aria-hidden="true"></i>
      </span>
    </button>
  </div>
  <div class="dropdown-menu">
    <div class="dropdown-content is-dropdown-toc">
      {{ .TableOfContents }}
    </div>
  </div>
</div>
{{- end }}

<hr>
