diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index 215ddc3..253e6b5 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -30,6 +30,9 @@ interface Props { const { entry }: Props = Astro.props; const { Content, headings, remarkPluginFrontmatter } = await render(entry); const postSlug = entry.id; +const lastUpdatedAt = entry.data.updated ?? entry.data.published; +const lastUpdatedLabel = formatDateToYYYYMMDD(lastUpdatedAt); +const lastUpdatedTimestamp = lastUpdatedAt.getTime(); const jsonLd = { "@context": "https://schema.org", @@ -111,6 +114,16 @@ const customcover = entry.data.customcover; )} +
+
+ +
+ 本文最后更新于 {lastUpdatedLabel},距今 计算中...。 + 随着时间推移,文中描述可能与当前实际情况有出入,请注意甄别。 +
+
+
+
-