This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
spdocker/themes/spd/layout/index.ejs
2018-03-07 15:58:54 +11:00

57 lines
1.5 KiB
Plaintext

---
layout: page
---
<!-- Main Content -->
<% page.posts.each(function(post){ %>
<div class="post-preview">
<a href="<%- config.root %><%- post.path %>">
<h2 class="post-title">
<%- post.title || "Untitled" %>
</h2>
<h3 class="post-subtitle">
<%- post.subtitle || "" %>
</h3>
<div class="post-content-preview">
<%- truncate(strip_html(post.content), {length: 200, omission: '...'}) %>...
</div>
</a>
<% if (config.home_posts_tag){%>
<p class="post-meta" style="margin: 10px 0;">
Posted by <%- post.author || config.author %> on
<%= post.date.format(config.date_format) %>
</p>
<div class="tags">
<% post.tags.forEach(function(tag){ %>
<a href="<%= config.root %>tags/#<%= tag.name %>" title="<%= tag.name %>"><%= tag.name %></a>
<% }) %>
</div>
<%} else {%>
<p class="post-meta">
Posted by <%- post.author || config.author %> on
<%= post.date.format(config.date_format) %>
</p>
<%}%>
</div>
<hr>
<% }); %>
<!-- Pager -->
<ul class="pager">
<% if (page.prev){ %>
<li class="previous">
<a href="<%- config.root %><%- page.prev_link %>">&larr; Newer Posts</a>
</li>
<% } %>
<% if (page.next){ %>
<li class="next">
<a href="<%- config.root %><%- page.next_link %>">Older Posts &rarr;</a>
</li>
<% } %>
</ul>