<% if (is_home() && page.current === 1) { %> <%- partial('_partial/index-cover') %> <% } else { %> <%- partial('_partial/bg-cover') %> <% } %>
<% if (page.current === 1 && ((theme.dream.enable || theme.music.enable) || theme.video.enable || theme.recommend.enable)) { %>
<% if (theme.dream.enable) { %> <%- partial('_widget/dream') %> <% } %> <% if (theme.music.enable && !theme.music.fixed) { %> <%- partial('_widget/music') %> <% } %> <% if (theme.video.enable) { %> <%- partial('_widget/video') %> <% } %> <% if (theme.recommend.enable) { %>
<%- partial('_widget/recommend') %>
<% } %>
<% }%> <% 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; }; %>
<% page.posts.forEach(post => { %>
<% if (post.img) { %> <%= post.title %> <% } else { %> <% var featureimg = '/medias/featureimages/0.jpg'; var featureImages = theme.featureImages; if (!featureImages || featureImages.length == 0) { return featureimg; } featureimg = featureImages[Math.abs(hashCode(post.title) % featureImages.length)] %> <%= post.title %> <% } %> <%= post.title %>
<% if (post.summary && post.summary.length > 0) { %> <%- post.summary %> <% } else if (post.excerpt && post.excerpt.length > 0) { %> <%- strip_html(post.excerpt).substring(0, 120) %> <% } else if (post.content && post.content.length > 0) { %> <%- strip_html(post.content).substring(0, 120) %> <% } %>
<%= date(post.date, config.date_format) %> <% if (post.categories && post.categories.length > 0) { %> <% post.categories.forEach(category => { %> <% }); %> <% } else if (post.author && post.author.length > 0) { %> <%- post.author %> <% } else { %> <%- config.author %> <% } %>
<% if(post.tags && post.tags.length > 0) { %> <% } %>
<% }); %>
<% if (page.total > 1) { %> <%- partial('_partial/paging') %> <% } %>