<% if (articles.length) { %>
<%
articles.sort(function(a,b){
return new Date(b.created_at) - new Date(a.created_at);
});
var resultsCount = 0;
%>
<% articles.forEach(function(article) { %>
<%
var section = sections.filter(function(section) { return section.id === article['section_id']; })[0] || null;
var category = section.category_id;
%>
<% if(resultsCount < 6) {%>
<% if(category == '200177446' && !article.promoted) { %>
<% resultsCount++; %>
<% } %>
<% } %>
<% }) %>
<% } %>