Skip to content

Commit fa1b803

Browse files
committed
Remove pagination feature
Signed-off-by: Shizuo Fujita <[email protected]>
1 parent d9ddcb3 commit fa1b803

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

app.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,7 @@ def blog_posts_all
293293
end
294294

295295
get '/blog/archive/' do
296-
page = params[:page].to_i
297-
page = 1 if page < 1
298-
posts = blog_posts_all
299-
total_pages = (posts.size.to_f / BLOG_ARTICLE_PER_PAGE).ceil
300-
slice = posts.slice((page - 1) * BLOG_ARTICLE_PER_PAGE, BLOG_ARTICLE_PER_PAGE) || []
301-
erb :blog_archive, locals: { posts: slice, page: page, total_pages: total_pages }
296+
erb :blog_archive, locals: { posts: blog_posts_all }
302297
end
303298

304299

views/blog_archive.erb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
<style>
2-
.pager{margin-top:20px;display:flex;gap:12px;align-items:center}
3-
.pager .page{opacity:.7}
4-
</style>
5-
61
<!--=== Breadcrumbs ===-->
72
<div class="breadcrumbs margin-bottom-40">
83
<div class="container">
@@ -19,14 +14,4 @@
1914
<% posts.each do |p| %>
2015
<p><%= p[:date].strftime("%Y-%m-%d") %>: <a href="<%= p[:url] %>"><%= p[:title] %></a></p>
2116
<% end %>
22-
23-
<nav class="pager">
24-
<% if page > 1 %>
25-
<a class="prev" href="?page=<%= page - 1 %>">&laquo; Newer</a>
26-
<% end %>
27-
<span class="page">Page <%= page %> / <%= total_pages %></span>
28-
<% if page < total_pages %>
29-
<a class="next" href="?page=<%= page + 1 %>">Older &raquo;</a>
30-
<% end %>
31-
</nav>
3217
</div>

0 commit comments

Comments
 (0)