W
W
Wynell_ru2019-08-29 10:18:27
Pug
Wynell_ru, 2019-08-29 10:18:27

How to solve this iteration problem in PugJS?

nav.navbar.navbar-expand.navbar-light.bg-light: div.collapse.navbar-collapse: ul.navbar-nav
  each group, group_name in links
    li.nav-item.col-12: span.font-weight-bold= group_name
    each link, link_name in group
      li.nav-item.col-12: a.nav-link(href='/'+link)= link_name

The only indentation option that works,
but I need li.nav-item.col-12: a.nav-linkthe nested loop not to enter the top element (from the top loop), but go after it
(not , but<upper><lower></lower></upper><upper></upper><lower></lower>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question