Hello! How to write the appearance of + e.block in a cycle, i.e. if we admit I will prescribe + breadcrumb ('One', 'Two') I only have after the first item added + e.block.

mixin breadcrumb(...items) // BEGIN section.b-breadcrumb +b('ul').breadcrumb&attributes(attributes) each item in items +e('li').item +e('a')(href="#" title=item).link= item if item > 1 +e('li').item--after-dot +e('a')(href="#" title=item).link= item +e.block +e('li').item--before-dot +e('a')(href="#" title=item).link= item // END section.b-breadcrumb 

    1 answer 1

    You can also get an iteration index in each:

     each item, index in items +e('li').item +e('a')(href="#" title=item).link= item if index > 0 +e('li').item--after-dot +e('a')(href="#" title=item).link= item +e.block +e('li').item--before-dot 
    • It only creates why 3 li now. It turns out: One, Two, Two - drtvader
    • This is a problem in your script logic. Apparently, you need the output e ('li'). Item also wrapped in a check that this is the first iteration. - Alexey Ukolov
    • thank! I will try then on. - drtvader