解决hugo无法使用git提交时间作为更新时间 @ shenmo | 2022-03-04T11:04:56+08:00 | 1 分钟阅读 | 更新于 2022-03-04T11:04:56+08:00

在此之前我一直以为是dream theme不支持git date作为修改日期,提了issue,直到……

https://github.com/g1eny0ung/hugo-theme-dream/issues/259
这就是和作者的issue,真没想到,这个theme已经很久没更新了,没想到作者还活着
解决方案在这里
https://github.com/gohugoio/hugo/issues/3071


The reason I ask about the macOS is the NFD way they store filenames.

So, given a Git repo:

▶ echo "test" >> π.txt                                                                       ◒
▶ git  add -A && git commit
[master (root-commit) a5dd87f] Test
 1 file changed, 1 insertion(+)
 create mode 100644 "\317\200.txt"

So, this is an issue that lives outside of Hugo.

Try:

git config --global core.quotePath false

Alternatively:

git config --global core.precomposeunicode true

更改后即可按git时间更改


为了让主页的排序转为修改日期,我把:git也加入了date优先序列,指定优先,不指定则为git时间,这样只要更新帖子就会放到最前面

更改位置:config.toml

同时更改了archetypes,以后的新的Post不会再指定创建日期,转而在帖子正文写明

© 2019 - 2024 shenmo的世界

Hugo theme Dream.

辽ICP备2021012180号-1

上面有备案号的

avatar
关于我

星火应用商店项目 Leader

社交链接

本博客所有文章使用《知识共享 署名-非商业性使用-相同方式共享 4.0》(CC-BY-NC-SA-4.0)协议

这意味着你可以在署名并标明出处的情况下进行非商业转载(转载的文章也需要遵守CC-BY-NC-SA-4.0协议),但不可以进行商业转载