generated from songquanpeng/blog-theme-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.ejs
36 lines (35 loc) · 1.06 KB
/
list.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<%- include('./partials/header') %>
<div class="w3-container w3-center">
<h2><%= title %></h2>
<table class="table is-fullwidth is-hoverable is-bordered is-striped">
<thead>
<tr>
<th>标题</th>
<th>发布时间</th>
<th>编辑时间</th>
</tr>
</thead>
<tbody>
<% pages.sort((a,b) => (a.createdAt > b.createdAt) ? 1 : ((b.createdAt > a.createdAt) ? -1 : 0)).forEach(page => { %>
<tr>
<td>
<a href="/page/<%= page.link %>">
<%= page.title %>
</a>
</td>
<td>
<time>
<%= page.createdAt.substring(0, 10) %>
</time>
</td>
<td>
<time>
<%= page.updatedAt.substring(0, 10) %>
</time>
</td>
</tr>
<% }) %>
</tbody>
</table>
</div>
<%- include('./partials/footer') %>