Aller au contenu principal
<%
var articleList = (typeof articles !== 'undefined' && articles) ? articles : [];
var sectionList = (typeof sections !== 'undefined' && sections) ? sections : [];
var getDate = function(article) { return article.created_at !== article.updated_at ? article.updated_at : article.created_at; }
var sortByDate = function(a, b) { return new Date(getDate(b)) - new Date(getDate(a)); }
articleList = articleList.slice().sort(sortByDate).slice(0, maxArticles);
%>
<% if (articleList.length) { %>
<% if (heading) { %>
<%= heading %>
<% } %>
<% } %>