{{define "base/navbar"}}
  <header class="j13-header">
    <div class="j13-header__inner">
      <a class="j13-brand" href="/">
        <span class="j13-brand__mark">{{.LogoMark}}</span>
        <span class="j13-brand__text">
          <strong>{{.SiteName}}</strong>
          {{if .Slogan}}<span class="j13-brand__slogan">{{.Slogan}}</span>{{end}}
        </span>
      </a>
      <nav class="j13-nav">
        <a href="/#search">搜索</a>
        <a href="/boards">板块</a>
        {{if .ShowFriendLinksNav}}<a href="/links">友链</a>{{end}}
        {{range .NavPages}}<a href="/page/{{.Slug}}">{{.Title}}</a>{{end}}
        {{if .LoggedIn}}
          <a href="/compose">发帖</a>
          <a href="/messages">私信{{if gt .UnreadCount 0}} <span class="j13-badge">{{.UnreadCount}}</span>{{end}}</a>
          <a href="/favorites">收藏</a>
          <a href="/profile">{{.ViewerName}} · {{.ViewerPoints}} 积分</a>
          {{if .IsAdmin}}<a href="/admin/dashboard">后台</a>{{end}}
          <form class="j13-inline-form" method="post" action="/logout">
            <input type="hidden" name="_csrf" value="{{.CSRF}}"/>
            <button type="submit" class="j13-linkbtn">退出</button>
          </form>
        {{else}}
          <a href="/register">注册</a>
          <a href="/login">登录</a>
        {{end}}
      </nav>
    </div>
  </header>
{{end}}
