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 49 50 |
----- filter: erb ----- <% def active_if(ident) if @item[:permalink] == ident then %{ class="active"} else "" end end %><div class="container"> <div class="row" id="header-row"> <div class="col-md-6 main-title"> <h1> <% if @item[:permalink] != 'home' then %> <a href="/"><img src="/img/h3rald.png" alt="H3RALD" /></a> <% else %> <img src="/img/h3rald.png" alt="H3RALD" /> <% end %> </h1> </div> <div class="col-md-4 col-md-offset-2"> <div class="gcse-searchbox" data-enableAutoComplete="true"></div> </div> </div> <div id="search_results"> <div class="gcse-searchresults" data-linkTarget="_top"></div> </div> <div id="main-navbar" class="navbar navbar-inverse" role="navigation"> <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> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li<%=active_if("home")%>><a href="/">HOME</a></li> <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> <li<%=active_if("contact")%>><a href="/contact/">CONTACT</a></li> </ul> </div> </div> </div> |