hugo中文件头有lastmod,可以在更改时,写入更改时间。可是我不想每次都改,想要自动更如何用呢?
基实hugo己经有这个功能了,只要在config.toml中设置就行了
1 | [frontmatter] |
- :git 从文件的 git 提交记录获取
- lastmod 从文件中的 lastmod 字段获取
- :fileModTime’ 从文件修改时间获取, 只要把这个放在字段第一个就行
- publishDate 文章发布时间
hugo如果想让文章排序从更新时间排如何设呢?
1 | [frontmatter] |
只要把date的字段第一个设为“lastmod”就行 date = [“lastmod”,…]
