<div class="navbar-dark bg-primary">
    <div class="container">
        <nav class="navbar navbar-expand-lg">
            <a class="navbar-brand" href="/">{{.SiteData.Subtitle}}</a>
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
                aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav mr-auto">
                    {{range $column := .Column}}
                    {{if $column.Children}}
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="{{$column.Href}}" role="button" data-toggle="dropdown"
                            aria-expanded="false">
                            {{$column.Name}}
                        </a>
                        <div class="dropdown-menu">
                            {{range $column := $column.Children}}
                            <a class="dropdown-item {{if $column.Selected}}active{{end}}" href="{{$column.Href}}"
                                target="{{$column.Target}}">{{$column.Name}}</a>
                            {{end}}
                        </div>
                    </li>
                    {{else}}
                    <li class="nav-item {{if $column.Selected}}active{{end}}">
                        <a class="nav-link" href="{{$column.Href}}" target="{{$column.Target}}">{{$column.Name}} <span
                                class="sr-only">(current)</span></a>
                    </li>
                    {{end}}
                    {{end}}

                </ul>
                <form class="form-inline mb-2 my-lg-0" action="/search">
                    <input class="form-control mr-sm-2" type="search"  name="key" value="{{if .IsSearch}}{{.one.Key}}{{end}}" placeholder="关键词" aria-label="Search">
                    <button class="btn btn-secondary mb-2 my-sm-0" type="submit">搜索</button>
                </form>
            </div>
        </nav>
    </div>
</div>