为什么 {{ page.date }} 在我的 jekyll 安装中不起作用?

Why isn't {{ page.date }} working in my jekyll install?

我在 github 页面站点上安装了我的旧博客,将其从 textpattern 传输到 jekyll。它位于名为 /journal 的子目录中。个人 post 显示 post 的日期没问题。

/journal/index.html page, {{ page.date | date: "%x" }}根本不起作用。

我需要添加什么才能使日期显示在博客的索引页上?

如果您在 index.html 中遍历 post,那么您需要使用 post 的日期而不是 page.date。它看起来像这样:

{% for post in paginator.posts %}
    {{ post.date | date: "%x" }}
{% endfor %}