<div id="sidebar">
  <a href="{{.Site.BaseURL}}" id="sidebar-logo"><img src="{{ "logo/logo.png" | relURL }}" width="100%" /></a>
  <div style="background-color: rgba(0, 0, 0, 0.1); width: 100%; height: 1px; min-height: 1px;"></div>
  <ul>
    {{ $currentPage := . }}
    {{ range .Site.Menus.main }}
      {{ if .HasChildren }}
        <li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}">{{ .Pre }}<span>{{ .Name }}</span></li>
        <ul class="sub-menu">
          {{ range .Children }}
            <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active-entry{{ end }}">
              <a href="{{ .URL }}">{{ .Name }}</a>
            </li>
          {{ end }}
        </ul>
      {{ else }}
        {{ if .Name }}
          <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active-entry{{ end }}">
            <a href="{{ .URL }}">
              {{ .Pre }}
              <span>{{ .Name }}</span>
            </a>
          </li>
        {{end}}
      {{ end }}
    {{ end }}
  </ul>
</div>