2.2主题next——配置更新时间

新版本废弃

配置更新时间 updated(适用于5.1.4)

1.修改/themes/next/layout/_macro/post.swig文件

1
2
3
4
5
6
7
8
9
<!-- 在`<span class="post-time">...</span>添加 -->
{%if post.updated and post.updated > post.date%}
<span class="post-updated">
&nbsp; | &nbsp; {{ __('post.updated') }}
<time itemprop="dateUpdated" datetime="{{ moment(post.updated).format() }}" content="{{ date(post.updated, config.date_format) }}">
{{ date(post.updated, config.date_format) }}
</time>
</span>
{% endif %}

2.在模板中添加updated

启动服务器,就可以看见更新时间(文件最后修改时间)

配置到这里打住