Answer the question
In order to leave comments, you need to log in
How to display element references in a loop?
There is a mixin that outputs a list through a loop. How can I make it so that each element can be assigned a link corresponding to it? Now for all elements, # is used as a link, but I need to be able to independently set a specific page for each link.
mixin list(...items)
ul.breadcrumbs
each item in items
li.breadcrumbs__item
a(href='#')= item
+list(1,2,3)
Answer the question
In order to leave comments, you need to log in
mixin list(...items)
ul.breadcrumbs
each item in items
li.breadcrumbs__item
a(href=item)= item
+list('https://www.google.ru/', 'https://toster.ru', 'https://toster.ru/q/590329')
mixin list(...items)
ul.breadcrumbs
each item in items
li.breadcrumbs__item
a(href='https://toster.ru/q/' + item)= item
+list(590329, 588072, 584712)
mixin list(...items)
ul.breadcrumbs
each item in items
li.breadcrumbs__item
a(href=item.link)= item.text
+list({ link: 'https://www.google.ru/', text: 'google' }, { link: 'https://toster.ru', text: 'toster' }, { link: 'https://toster.ru/q/590329', text: 'ваш вопрос' })
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question