basham / v4.bash.am

Portfolio, since Nov 2014.

Home Page:http://bash.am

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Example:

- 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.