码农笔录博客源码
您最多能選擇 25 個主題 主題必須以字母或數字為開頭,可包含連接號「-」且最長為 35 個字元。
 
 
 
 
 

55 行
2.6 KiB

{{define "nav"}}
<div class='nav-container'>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="/">个人随笔</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li {{if .IsHome}} class="active" {{end}}>
<a href="/">首页 </a>
</li>
<li {{if .IsBlog}} class="active" {{end}}>
<a href="/blogs" target="_blank">博客 </a>
</li>
<li>
<a href="/note" target="_blank">笔记</a>
</li>
<li {{if .IsMap}} class="active" {{end}}>
<a href="/map" target="_blank">地图</a>
</li>
</ul>
{{/*<form class="navbar-form navbar-left" role="search">*/}}
{{/*<div class="form-group">*/}}
{{/*<input type="text" class="form-control" placeholder="Search">*/}}
{{/*</div>*/}}
{{/*<button type="submit" class="btn btn-default">Submit</button>*/}}
{{/*</form>*/}}
<ul class="nav navbar-nav navbar-right">
{{if .IsLogin }}
{{/*<li><a href="#"></a></li>*/}}
<li><a href="/" style="padding: 0;"><img src="/static/img/2.png" alt="头像" class="img-circle"></a></li>
{{else}}
<li><a href="/login">登录</a></li>
<li><a href="/regist">注册</a></li>
{{end}}
{{if .IsLogin }}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
{{.NickName}}<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#">个人中心</a></li>
<li><a href="/note" target="_blank">我的笔记</a></li>
<li><a href="/note" target="_blank">我的首页</a></li>
<li class="divider"></li>
<li><a href="/logout">安全退出</a></li>
</ul>
</li>
{{end}}
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</div>
{{end}}