hugo-fixit / FixIt

🔧 A clean, elegant but advanced blog theme for Hugo 一个简洁、优雅且高效的 Hugo 主题
https://fixit.lruihao.cn
MIT License
646 stars 96 forks source link

[FEATURE] 通过 git 读取日期 Reading the date via git #444

Closed 117503445 closed 1 month ago

117503445 commented 3 months ago

Describe the feature you want 描述你的功能需求

https://fixit.lruihao.cn/zh-cn/documentation/content-management/introduction 提到

date: 这篇文章创建的日期时间它通常是从文章的前置参数中的 date 字段获取的,但是也可以在 主题配置 中设置

但我在主题配置中没有找到相关设置。

我的期望是当文章的前置参数没有 date 时,读取 git 中文章文件的最后修改时间作为日期。

Useful reference 有价值的参考

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin

Lruihao commented 3 months ago

理论上你可以设置 frontmatter.toml 来实现。

date = [":git", "date"]
Lruihao commented 3 months ago

另外,这是属于hugo的设计,主题无法干预。