{{- $SP := .Site.Params -}}
<aside class="sidebar">
  <div class="sidebar-inner sidebar-overview-active">
    <ul class="sidebar-nav">
      <li class="sidebar-nav-toc">{{ T "TableOfContents" }}</li>
      <li class="sidebar-nav-overview">{{ T "SiteInfo" }}</li>
    </ul>
    <div class="sidebar-panel-container">
      <div class="post-toc-wrap sidebar-panel">
      </div>
      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image" alt="{{ $SP.author }}" src="{{ $SP.avatar.url }}">
          <p class="site-author-name" itemprop="name">{{ $SP.author }}</p>
          <div class="site-description" itemprop="description">{{ $SP.description }}</div>
        </div>
        <div class="site-state-wrap site-overview-item animated">
          {{- if $SP.siteState }}
          <nav class="site-state">
            <div class="site-state-item site-state-posts">
              <a href="{{ "/archives/" | relLangURL }}">
                <span class="site-state-item-count">{{ len (where .Site.RegularPages "Section" "in" .Site.Params.mainSections) }}</span>
                <span class="site-state-item-name">{{ T "SitePostsTitle" }}</span>
              </a>
            </div>
            <div class="site-state-item site-state-categories">
              <a href="{{ "/categories/" | relLangURL }}">
                <span class="site-state-item-count">{{ len .Site.Taxonomies.categories }}</span>
                <span class="site-state-item-name">{{ T "SiteCatesTitle" }}</span>
              </a>
            </div>
            <div class="site-state-item site-state-tags">
              <a href="{{ "/tags/" | relLangURL }}">
                <span class="site-state-item-count">{{ len .Site.Taxonomies.tags }}</span>
                <span class="site-state-item-name">{{ T "SiteTagsTitle" }}</span>
              </a>
            </div>
          </nav>
          {{- end }}
          <div class="rss-link">
            <a href="{{ "/index.xml" | relLangURL }}" rel="alternate" type="application/rss+xml" target="_blank">
              <i class="fa fa-rss"></i>
              {{ T "RSSTitle" }}
            </a>
          </div>
        </div>
        <div class="links-of-social site-overview-item animated">
          {{ $si := $SP.socialIcons }}
          {{- range $SP.socials }}
          {{- range $name,$val := . }}
          {{- $vals := split $val "||" }}
          {{- $url := trim (index $vals 0) " " }}
          {{- $icon := trim (index $vals 1) " " }}
          <span class="links-of-social-item">
            <a href="{{- $url }}" title="{{- $name }} → {{- $url }}" rel="noopener" {{- if and $si.enable $si.transition }} class="hvr-icon-pulse" {{- end }} target="_blank">
              {{- if $si.enable }}
              <i class="{{- $icon }} fa-fw {{ if $si.transition }} hvr-icon {{ end }}"></i>
              {{- end }}
              {{- if or (not $si.enable) (not $si.iconsOnly) }}
                 {{- $name }}
              {{- end }} 
            </a>
          </span>
          {{- end }}
          {{- end }}
        </div>
        {{- $cc := $SP.creativeCommons }}
        {{- if and $cc $cc.sidebar }}
        <div class="cc-license animated" itemprop="license">
          <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.{{ substr .Site.Language 0 2 }}" class="cc-opacity" rel="noopener" target="_blank" title="{{ T "CCLinkTitle" }}">
            <img src="/imgs/cc/{{ $cc.size }}/{{ replace $cc.license "-" "_" }}.svg" alt="{{ T "CCLinkTitle" }}">
          </a>
        </div>
        {{ end }}
      </div>
    </div>
    <div class="back-to-top" role="button" aria-label="返回顶部">
      <i class="fa fa-arrow-up"></i>
      <span>0%</span>
    </div>
  </div>
</aside>