Repeat an action x number of time using a range

In ruby or swift it’s possible to use a range to repeat an action a x number of times. For example:

# pseudo code
# publish icon 9 times
for n in 0..9 {
  <icon/>
}

Is it possible to achieve the same using the range function? Or is there a better way/function for this purpose?

You can use range with seq: https://gohugo.io/functions/seq/#example-seq-with-range-and-after

1 Like