angular-cn/public/docs/_includes/sidenav/_secondary.jade

40 lines
1.3 KiB
Plaintext

- var secondaryPath = public.docs[current.path[1]][current.path[2]][current.path[3]]
if secondaryPath
- var data = secondaryPath._data
- var listType = data._listtype
- var ordered = listType == "ordered" ? "is-ordered" : ""
- var items = listType == 'api' ? secondaryPath : data
- var number = 1
//SECONDARY NAVIGATION
ul(class="side-nav-secondary #{ordered}")
for page, slug in items
// DEFAULT LIST VALUES
- var selected = current.path[4] == slug ? 'is-selected':''
- var name = page.title;
- var path = "/docs/" + current.path[1] + "/" + current.path[2] + "/" + current.path[3] + "/" + slug + ".html"
if slug != "_listtype" && slug != 'index' && slug != '_contents' && slug != '_data'
// API LIST VALUES
if listType == 'api'
- var name = public.docs[current.path[1]][current.path[2]][current.path[3]][slug]._data["index"]["title"]
- var path = "/docs/" + current.path[1] + "/" + current.path[2] + "/" + current.path[3] + "/" + slug
// ORDERED LIST VALUES
if listType == 'ordered'
- var num = number++
- var name = (listType == "ordered") ? num + '. ' + page.title : page.title;
li(class="#{selected}") <a href="#{path}" md-button>#{name}</a>
// TERTIARY NAVIGATION
if selected
!= partial("_tertiary")