aboutsummaryrefslogblamecommitdiff
path: root/src/_mixin/menu.pug
blob: d724eaf4d2699d4fe41433109f1e74a3595256f7 (plain) (tree)
1
2
3
4
5
6
7
8
9
                      

                          
                                                                  
          
                                               
                                                                                                  

                               

                                              

                                                                                                       
                                                                                          
mixin menu(o, element)
  ul
    each val in o.children
      - if (val.type == 'folder' && val.tags.includes('document'))
        li
          - if (val.tags.includes('has_index'))
            a(href=val.url, class=val.index.url == element.url ? 'selected' : null)= val.nice_name
          - else
            span= val.nice_name
          - if (element.url.includes(val.url))
            +menu(val, element)
      - else if (val.type == 'file' && val.tags.includes('document') && !val.tags.includes('is_index'))
        li
          a(href=val.url, class=val.url == element.url ? 'selected' : null)= val.nice_name