<%- partial('_partial/bg-cover-content') %>
<%- partial('_partial/social-link') %>
<% if (coverPostsCount > 0) { %>
<%
var hashCode = function (str) {
if (!str && str.length === 0) {
return 0;
}
var hash = 0;
for (var i = 0, len = str.length; i < len; i++) {
hash = ((hash << 5) - hash) + str.charCodeAt(i);
hash |= 0;
}
return hash;
};
var featureImages = theme.featureImages;
var imgCount = featureImages.length;
%>
<% for (var i = 0; i < coverPostsCount; i++) { %>
<%
var post = coverPosts[i];
var featureImage = featureImages[Math.abs(hashCode(post.title) % imgCount)];
var coverImg;
if (post.coverImg) {
coverImg = post.coverImg;
} else if (post.img) {
coverImg = post.img;
} else {
coverImg = featureImage;
}
%>