Initial upload
uploaded v0.1
This commit is contained in:
parent
7ca416624c
commit
ffb8736de2
13 changed files with 642 additions and 0 deletions
28
layout/_partial/article.ejs
Normal file
28
layout/_partial/article.ejs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<!-- This is the template for the post. -->
|
||||
<div class="post">
|
||||
<div class="post-header">
|
||||
<h1 class="article"><%= page.title || "Untitled" %></h1>
|
||||
<% if(page.photos) { %>
|
||||
<div class="cover">
|
||||
<img class="gallery" src="<%- config.root %><%- page.photos %>" alt="<%- page.title || "Untitled" %>">
|
||||
</div>
|
||||
<% } %>
|
||||
<p class="post_description"><%= page.description %></p>
|
||||
<% if(page.content) { %>
|
||||
<hr class="page-divider">
|
||||
<% } %>
|
||||
<a href='<%= url_for(page.path) %>' class="page-date"><%- include('date', { date: page.date.toISOString() }) %></a>
|
||||
</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>
|
||||
11
layout/_partial/date.ejs
Normal file
11
layout/_partial/date.ejs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<div class="date smoll">
|
||||
<%
|
||||
const posted = new Date(date);
|
||||
const now = new Date();
|
||||
const year = 365 * 24 * 60 * 60 * 1000;
|
||||
const format = (now - posted) < year ?
|
||||
{ day: 'numeric', month: 'long', hour: 'numeric', minute: 'numeric', hour12: true } :
|
||||
{ day: 'numeric', month: 'long', year: 'numeric', hour: 'numeric', minute: 'numeric', hour12: true };
|
||||
%>
|
||||
<%= posted.toLocaleString('en-US', format ) %>
|
||||
</div>
|
||||
28
layout/_partial/feed.ejs
Normal file
28
layout/_partial/feed.ejs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<!-- Default number of columns is two. If 3 is defined, then third column is added-->
|
||||
<% columns = theme.column; %> <!-- Number of columns -->
|
||||
<div class="posts-container">
|
||||
<div class="column column-0">
|
||||
<% item.forEach(function(post, index) { %>
|
||||
<% if (index % columns === 0) { %>
|
||||
<%- include('post_feed', { post: post }) %>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
</div>
|
||||
<div class="column column-1">
|
||||
<% item.forEach(function(post, index) { %>
|
||||
<% if (index % columns === 1) { %>
|
||||
<%- include('post_feed', { post: post }) %>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
</div>
|
||||
<!-- Condition for column number 3 -->
|
||||
<% if (columns === 3) { %>
|
||||
<div class="column column-2">
|
||||
<% item.forEach(function(post, index) { %>
|
||||
<% if (index % columns === 2) { %>
|
||||
<%- include('post_feed', { post: post }) %>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
</div>
|
||||
<% } %>
|
||||
</div>
|
||||
18
layout/_partial/post_feed.ejs
Normal file
18
layout/_partial/post_feed.ejs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<!-- This is the template for the post. It is used to display the posts in the feeds. -->
|
||||
<div class="post">
|
||||
<% if(post.photos) { %>
|
||||
<div class="cover">
|
||||
<img class="gallery" src="<%- config.root %><%- post.photos %>" alt="<%- post.title || "Untitled" %>">
|
||||
</div>
|
||||
<% } %>
|
||||
<div class="post-header">
|
||||
<h2><%= post.title || "Untitled" %></h2>
|
||||
<a href='<%= url_for(post.path) %>'><%- include('date', { date: post.date.toISOString() }) %></a>
|
||||
<p><%= post.description %></p>
|
||||
<div class="tags smoll">
|
||||
<% post.tags.data.forEach(function(tag) { %>
|
||||
<a href="<%= url_for('/tags/' + tag.name) %>">#<%= tag.name %></a>
|
||||
<% }); %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
17
layout/_partial/scarves.ejs
Normal file
17
layout/_partial/scarves.ejs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<div class="scarves">
|
||||
<% theme.scarf.forEach(function(scarf, index) { %>
|
||||
<% if (scarf.enable) { %>
|
||||
<a href="<%= scarf.url %>">
|
||||
<div class="scarf" title="<%= scarf.alt %>" style="right: <%= index * 30 %>px;
|
||||
margin-top:-<%= ( (index % 5) * 10) + 40 %>px;
|
||||
background-color:<%= scarf.color ? scarf.color : theme.primary_color %>;">
|
||||
<% if(scarf.image) { %>
|
||||
<img class= "logo" src="<%= url_for(scarf.image) %>" alt="<%= scarf.alt %>">
|
||||
<% } else if(scarf.icon) { %>
|
||||
<i class='logo <%= scarf.icon %>'></i>
|
||||
<% } else%>
|
||||
</div>
|
||||
</a>
|
||||
<% } %>
|
||||
<% }); %>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue