30 lines
1.3 KiB
Plaintext
30 lines
1.3 KiB
Plaintext
<div class="banner-wrapper">
|
|
<%- include('widgets/banner', {titleText1: theme.banner.title, titleText2: theme.banner.subtitle}) %>
|
|
</div>
|
|
<mdui-layout-main>
|
|
<div class="articles-container">
|
|
<%
|
|
const sortedPosts = Array.from(site.posts.data || site.posts).sort((a, b) => {
|
|
const dateA = a.date ? new Date(a.date).getTime() : new Date(a.updated).getTime();
|
|
const dateB = b.date ? new Date(b.date).getTime() : new Date(b.updated).getTime();
|
|
|
|
return dateB - dateA;
|
|
});
|
|
%>
|
|
|
|
<% if (sortedPosts && sortedPosts.length > 0) { %>
|
|
<% sortedPosts.forEach((post) => { %>
|
|
<%- include('widgets/index/post-card', {post: post}) %>
|
|
<% }); %>
|
|
<% } else { %>
|
|
<mdui-card class="no-articles" variant="filled">
|
|
<mdui-typography variant="h4" style="margin-bottom: 1rem; color: var(--mdui-color-on-surface);">
|
|
<%= __('index.no_articles') %>
|
|
</mdui-typography>
|
|
<mdui-typography variant="body1" style="color: var(--mdui-color-on-surface-variant);">
|
|
<%= __('index.no_articles_desc') %>
|
|
</mdui-typography>
|
|
</mdui-card>
|
|
<% } %>
|
|
</div>
|
|
</mdui-layout-main> |