What does “for ep in site.posts” do?

Hi! I’m currently building a blog with a podcast using Jekyll and was researching how to create an .rss file for a podcast. I looked at this iTunes.rss file, but am not sure what the for loop on line 28 does: what does {% for ep in site.posts %} do?

Thanks!

that looks like the main loop to go thru all the posts.

ep is just the iterator(?) and could be called anything - probably means episode to the person who created it. I usually call it item to make it more clear that it is just the name of what you want to refer to each thing in the loop - item.url or ep.url etc.

1 Like