layouts/header.erb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
----- filter: erb ----- <% def active_if(ident) if @item[:permalink] == ident then %{ class="active"} else "" end end %><header class="container nav-container"> <div id="main-navbar" class="navbar navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <h1 class="navbar-brand"> <% if @item[:permalink] != 'home' then %> <a href="/" class="h3 h3-header"></a> <% else %> <span class="h3 h3-header"></span> <% end %> </h1> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li<%=active_if("projects")%>><a href="/projects/">PROJECTS</a></li> <li<%=active_if("tags")%>><a href="/tags/">TAGS</a></li> <li<%=active_if("archives")%>><a href="/archives/">ARCHIVES</a></li> <li<%=active_if("about")%>><a href="/about/">ABOUT</a></li> </ul> <div class="navbar-form"> <div class="input-group"> <input type="text" class="form-control" name="q" placeholder="Search" id="h3rald-search-box"> <span class="input-group-btn"> <button class="btn btn-default" id="h3rald-search-btn" type="button"><i class="fa fa-search"></i></button> </span> </div> </div> </div> </div> </div> </header> |