openalt_ro/themes/openalt/layout/post.ejs

44 lines
No EOL
1.5 KiB
Text

<%
isEvent = false
page.tags.data.forEach(function(tag) {
if ( (tag.name == "Events") && (!isEvent) ) {
isEvent = true
}
});
%>
<div class="post-page post">
<% if(page.photos && page.photos.length) { %>
<div class="post-cover">
<img class="gallery" src="<%- config.root %><%- page.photos[0] %>" alt="<%- page.title || "Untitled" %>">
</div>
<% } %>
<div class="post-text-wrapper">
<% if(isEvent) { %>
<div class="post-event">
<%- include('_partial/event') %>
<% } else { %>
<div class="post-text">
<div class="post-header">
<h1 class="article"><%= page.title || "Untitled" %></h1>
<span class="smoll"><%- include('_partial/date', { date: page.date.toISOString() }) %> by <%= page.author %></span>
<p><%= page.description %></p>
</div>
<div class="post-content">
<%- page.content %>
</div>
<div class="post-footer">
<div class="tags smoll">
<% if (page.tags) { %>
<% page.tags.data.forEach(function(tag) { %>
<a href="<%= url_for('/tags/' + tag.name) %>">#<%= tag.name %></a>
<% }); %>
<% } else {console.log(page)} %>
</div>
</div>
<% } %>
</div>
</div>
</div>