Add active style to primary navigation
basham opened this issue · comments
Add an --active
class name and style to primary nav items based on current file path or current collection.
- menu = [{title:"Accueil", url: "/", collection:""}, {title:"Blog", url: "/blog", collection:"blog"}, {title:"Freelance", url: "/pages/freelance", collection:""}, {title:"Contact", url: "/pages/contact", collection:""}]
ul.nav.navbar-nav.navbar-center
each page in menu
- var is_current = (path == page.url || collection == page.collection)
li(class=is_current?'active':'')
a(href=page.url)=page.title
Ignoring this, since navigation will never be more than one level deep. And each page has an obvious heading. Should be easy to orient.