Jekyll - 获取最后 post 的日期

Jekyll - Get the date of the last post

我知道我可以通过 post.date 获得 post 日期。

但是,我怎样才能得到最后一个 post 的日期或与网站最后一次生成相关的日期?

我想回应这样的事情: Last update: {{ getDate }}

You want site.time,这将显示网站上次生成的准确 date/time:

2015-07-22 17:11:02 +0200

要输出你想要的确切日期格式,你可以使用Liquid's date formatting

例如{{ site.time | date: "%-d %B %Y"}}会生成22 July 2015.