Nested loops can be done not by nesting loops over two separate lists, but by looping over the [[cartesian-product]] of the two using the `product` filter. `{{ list1 | product(list) | list }}`