<% counter = false %> <% page.posts.forEach(function(post) { %> <% post.tags.data.forEach(function(tag) { %> <% if ( (tag.name == "Events") && (counter == false) ) { %> <%- include('./../post_event', { post: post }) %> <% counter = true %> <% } %> <% }); %> <% }); %>