I tried to wrap my brain around this one. I believe it is counting off every 5 .Site.RegularPages , but I don’t understand how the pieces fit together.
I was hoping I could deconstruct it enough to figure out how to limit the number of times it would insert <div>Put Your Banner Here</div>.
Posting my final solution here in case anyone else finds this helpful:
{{ range $article_index, $article_array := $paginator.Pages }}
{{ if eq $article_index 7 }}
<div>Put Your Banner Here</div>
{{ end }}
<a href="{{.RelPermalink}}">{{.Title}}</a>
{{ end }}
I suspect you will get unrelated content if you Google that. But the key part here is that every operator and most keywords is a function (eq, and, or etc.).
Between the link to the docs you shared (eq) and a quick google, things are making a bit more sense! Thanks again!
Between the clarity of the code and the community here, transitioning to Hugo has been a joy! I was on an old version of Middleman, tried to upgrade and couldn’t figure it out. Then tried to migrate to Gatsby, got 80% done, but couldn’t figure out that last bits. Switched to Hugo and had my entire site redone in less than a month. Thank you, Hugo and the awesome community here! <3