个人博客搭建hexo+github(7):显示每篇文章的更新时间

纪晓君-爱延续

NexT主题从6.0开始只需要简单的配置就支持显示或者不显示更新时间了。

配置NexT主题

enable display updated date
1
2
3
4
5
6
7
8
9
10
11
# Post meta display settings
post_meta:
item_text: true
created_at: true. # 发表于
updated_at:
enabled: true #更新于
# If true, show updated date label only if `updated date` different from 'created date' (post edited in another day than was created).
# And if post will edited in same day as created, edited time will show in popup title under created time label.
# If false show anyway, but if post edited in same day, show only edited time.
another_day: true
categories: true

配置post layout参数

每篇post(md文件)的layout参数modified(或者updated)就是文章的更新时间。
如果modifieddate相同,则只显示发表时间,不显示更新时间;如果modifieddate不同,则date显示为发表时间,modified显示为更新时间;

1
2
3
4
5
6
7
8
9
10
title: '个人博客搭建hexo+github(7):显示每篇文章的更新时间'
categories:
- hexo
tags: [hexo, github, blog]
comments: true
layout: post
date: 2015-12-13 20:18:54
modified: 2018-12-29 20:18:54
---
以下为正文。

Reference:

  1. Landscape-F
  2. Front Matter
  3. NexT them settings