How do you repeat string multiple times in Jekyll?
For eg: in Python, you can do "hello" * 5
to get 'hellohellohellohellohello'
. In Jekyll is there an easier way of doing the same thing than this.
{% for i in (1..5) %}
Hello
{% endfor %}
Example
Say you want to display a star rating and you are using <i class="fa fa-star"></i>
to display each star. So to display a 5 star rating you would do.
{% for i in (1..5) %}
<i class="fa fa-star"></i>
{% endfor %}
A single page may have many ratings displayed on it so you would be using several instances of that for loop.