site/src/_mixin/menu.pug

14 lines
563 B
Text
Raw Normal View History

2020-05-10 18:16:34 +00:00
mixin menu(o, element)
2020-04-18 10:00:23 +00:00
ul
each val in o.children
2020-04-18 15:17:54 +00:00
- if (val.type == 'folder' && val.tags.includes('document'))
2020-04-18 10:00:23 +00:00
li
2020-04-18 15:17:54 +00:00
- if (val.tags.includes('has_index'))
2020-05-10 18:16:34 +00:00
a(href=val.url, class=val.index.url == element.url ? 'selected' : null)= val.nice_name
2020-04-18 15:17:54 +00:00
- else
span= val.nice_name
2020-05-10 18:16:34 +00:00
+menu(val, element)
2020-04-18 15:17:54 +00:00
- else if (val.type == 'file' && val.tags.includes('document') && !val.tags.includes('is_index'))
li
2020-05-10 18:16:34 +00:00
a(href=val.url, class=val.url == element.url ? 'selected' : null)= val.nice_name