From 0366e44652178687bbcdd02685d80d043854176f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Thu, 6 May 2021 09:49:12 +0800 Subject: [PATCH] =?UTF-8?q?layout:=E6=9B=B4=E6=96=B0=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E6=9C=9F=E6=97=B6=E9=97=B4=E5=A4=84=E7=90=86?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/grid/layout/partial/post/list.ejs | 4 ++-- themes/grid/layout/post.ejs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/grid/layout/partial/post/list.ejs b/themes/grid/layout/partial/post/list.ejs index 310ef0d..8c538c3 100644 --- a/themes/grid/layout/partial/post/list.ejs +++ b/themes/grid/layout/partial/post/list.ejs @@ -8,8 +8,8 @@
发布:<%= date(post.date, "YYYY-MM-DD HH:mm") %>
- <% let updateValid = typeof(post.update) == 'string' %> -
更新:<%= date(updateValid ? post.update : post.date, "YYYY-MM-DD HH:mm") %>
+ <% const updateValid = post.updated.isValid() %> +
更新:<%= date(updateValid ? post.updated : post.date, "YYYY-MM-DD HH:mm") %>
<% if (post.categories.length> 0) { %>
知识分类: <%- list_categories(post.categories, { diff --git a/themes/grid/layout/post.ejs b/themes/grid/layout/post.ejs index 4f4565d..67f1cdb 100644 --- a/themes/grid/layout/post.ejs +++ b/themes/grid/layout/post.ejs @@ -9,8 +9,9 @@
-
最后更新:<%= date(page.date, "YYYY-MM-DD HH:mm" ) %> -
+
发布时间:<%= date(page.date, "YYYY-MM-DD HH:mm" ) %>
+ <% const validUpdate = page.updated.isValid() %> +
最后更新:<%= date(validUpdate ? page.updated : page.date, "YYYY-MM-DD HH:mm") %>
<% if (page.categories.length> 0) { %>
知识分类: <%- list_categories(page.categories, {