Skip to content

Commit

Permalink
feat: remove pagination variable (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang authored Dec 25, 2024
1 parent c3474d9 commit 3a60275
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 29 deletions.
45 changes: 19 additions & 26 deletions layout/_partial/archive.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,26 @@ if (page.archive){
%>
<h2 class="archive-title<% if (page.tag){ %> tag<% } else if (page.category){ %> category<% } %>"><%= title %></h2>

<% if (pagination == 2){ %>
<div class="archive">
<% page.posts.each(function(item){ %>
<%- partial('article', {item: item, index: true}) %>
<% }); %>
<% } else { %>
<div class="archive">
<% page.posts.each(function(item){ %>
<article class="<%= item.layout %>">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="<%= item.date.toDate().toISOString() %>"><a href="<%- url_for(item.path) %>"><%= item.date.format(config.date_format) %></a></time>
<% if (item.link){ %>
<% if (item.title){ %>
<h1 class="title link"><a href="<%- item.link %>" target="_blank"><%= item.title %></a></h1>
<% } else { %>
<h1 class="title link"><a href="<%- item.link %>" target="_blank"><%= item.link %></a></h1>
<% } %>
<article class="<%= item.layout %>">
<div class="post-content">
<header>
<div class="icon"></div>
<time datetime="<%= item.date.toDate().toISOString() %>"><a href="<%- url_for(item.path) %>"><%= item.date.format(config.date_format) %></a></time>
<% if (item.link){ %>
<% if (item.title){ %>
<h1 class="title link"><a href="<%- item.link %>" target="_blank"><%= item.title %></a></h1>
<% } else { %>
<h1 class="title"><a href="<%- url_for(item.path) %>"><%= item.title %></a></h1>
<h1 class="title link"><a href="<%- item.link %>" target="_blank"><%= item.link %></a></h1>
<% } %>
</header>
</div>
</article>
<% }); %>
</div>
<% } %>
<% } else { %>
<h1 class="title"><a href="<%- url_for(item.path) %>"><%= item.title %></a></h1>
<% } %>
</header>
</div>
</article>
<% }); %>
</div>

<%- partial('pagination') %>
<%- partial('pagination') %>
2 changes: 1 addition & 1 deletion layout/archive.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%- partial('_partial/archive', {pagination: config.archive}) %>
<%- partial('_partial/archive') %>
2 changes: 1 addition & 1 deletion layout/category.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%- partial('_partial/archive', {pagination: config.category}) %>
<%- partial('_partial/archive') %>
2 changes: 1 addition & 1 deletion layout/tag.ejs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<%- partial('_partial/archive', {pagination: config.tag}) %>
<%- partial('_partial/archive') %>

0 comments on commit 3a60275

Please sign in to comment.