diff options
author | Doge <[email protected]> | 2021-05-09 15:18:10 +0800 |
---|---|---|
committer | Doge <[email protected]> | 2021-05-09 15:18:10 +0800 |
commit | 832ebd0038ccecbd6bbd5baa337c8d59e19542f7 (patch) | |
tree | 6d4594ba8a982d188047467d2d8e4978268af2d2 /layout/index.ejs | |
parent | eac5f3f8a7005d277208480f7af480c317724805 (diff) | |
download | chromate-832ebd0038ccecbd6bbd5baa337c8d59e19542f7.tar.gz chromate-832ebd0038ccecbd6bbd5baa337c8d59e19542f7.tar.bz2 chromate-832ebd0038ccecbd6bbd5baa337c8d59e19542f7.zip |
Add pagination support
Diffstat (limited to 'layout/index.ejs')
-rw-r--r-- | layout/index.ejs | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/layout/index.ejs b/layout/index.ejs index 78fc04e..53335fe 100644 --- a/layout/index.ejs +++ b/layout/index.ejs @@ -2,10 +2,9 @@ <div class="hero-body"> <div class="container"> <% page.posts.each(function (post) { %> - <div class="columns"> + <div class="columns post-entry"> <div class="column is-8 is-offset-2"> <div class="card"> - <!-- Post thumbnail with lazayload support --> <% if (post.thumbnail) { %> <div class="card-iamge"> @@ -18,9 +17,11 @@ <% } %> <% } %> </figure> + </div> <% } %> - <div class="card-content"> + <div class="card-content"> + <!-- Post title --> <p class="title is-4"> <%= post.title %> @@ -75,49 +76,42 @@ <p><%- post.content %></p> <% } %> </section> - </div> + <div class="card-footer"> <a href="<%- url_for(post.path) %>" class="card-footer-item has-text-danger has-text-weight-medium is-uppercase"> <% if (post.podcast && theme.podcast) { %> - Listen Now + <%- __("listen") %> <% } else { %> - Continue Read + <%- __("read") %> <% } %> </a> </div> + </div> </div> </div> - <% }); %> + <% }); %> + + <!-- Page navigation --> + <% if (page.prev || page.next) { %> + <div class="columns pagination-bar"> + <div class="column is-8 is-offset-2"> + <nav class="pagination is-centered" role="navigation" aria-label="pagination"> + <% if (page.prev) { %> + <a class="button is-light" href="<%- url_for(page.prev_link) %>"><%- __("prev") %></a> + <% } else { %> + <a class="button is-disabled is-light" disabled><%- __("prev") %></a> + <% } %> + <% if (page.next) { %> + <a class="button is-light" href="<%- url_for(page.next_link) %>"><%- __("next") %></a> + <% } else { %> + <a class="button is-disabled is-light" disabled><%- __("next") %></a> + <% } %> + </nav> + </div> + </div> + <% } %> </div> </div> </section> - -<!-- Page navigation --> -<!-- <% if (page.prev || page.next) { %> - <div class="nav"> - <% if (page.prev) { %> - <div class="nav-prev"> - <a href="<%- url_for(page.prev_link) %>" class="nav-link"> - <span class="nav-label"> - Prev - <i class="fa fa-chevron-left"></i> - </span> - </a> - </div> - <% } %> - <% if (page.next) { %> - <div class="nav-next"> - <a href="<%- url_for(page.next_link) %>" class="nav-link"> - <span class="nav-label"> - Next - <i class="fa fa-chevron-right"></i> - </span> - </a> - </div> - <% } %> - </div> -<% } %> --> - -</section>
\ No newline at end of file |