New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
升级主题后,文章会刷新更新日期,时间为刚才的部署时间 #60
Comments
主题使用 hexo 提供的 但主题对此信息进行处理判断是不合适的,因此我觉得最好的方式是文章初始化时,自动生成 updated 字段,其时间与 date 相同即可,hexo 将读取该字段作为更新日期。 可以修改 ---
title: {{ title }}
date: {{ date }}
updated: {{ date }}
tags:
categories:
--- |
看起来不是,好像通过 CI 自动部署,就会变成网站时候,就会更新 能默认设置为一下? |
如果主题默认设置不显示更新时间的话,反之就无法实现「默认显示文件修改日期作为更新日期」这一需求了。 或者是否有其他方案建议? |
未设置时候,默认返回修改时间和 date 一样即可?这样或许更好 (创建时间和修改时间一致)🍀 |
这部分是由 hexo 默认返回的,不是主题设置的。 |
我在 hexo 文档找到了相关的设置,你可以通过设置 hexo 的 |
修改 hexo 工作目录下 # updated_option: "mtime"
updated_option: "date"
|
谢谢, 我晚上试一下 |
如果仍有问题,可以重启该 Issue。 |
最近有点繁忙,刚升级了一下 yun v1.0, 很棒~~~~ |
记得 |
如果想要不显示更新日期,应当将 |
能否提供一下仓库文件以供测试?我本地的文章时间显示测试正常。 |
我把整个文件夹压缩后都发给你,已经私发给你了, 提供你测试使用(只移除了半文章,减小体积) |
@XMuli 我似乎明白问题所在了。你使用的是 hexo v4.2.1。而 hexo v5.0 已经由原先的配置项 |
@YunYouJun 是的, 当我升级完 hexo v5.0 版本之后,回复之前的正常显示了;十分感谢你的帮助,且升级后,是有出现如下提示验证了你的猜想: WARN Deprecated config detected: "use_date_for_updated" is deprecated, please use "updated_option" instead. See https://hexo.io/docs/configuration for more details. |
因为问题已得到解决,我将关闭该 Issue。 |
给后面的人一个参考:Hexo 升级教程 |
前几天,更新 yun v0.9.7 后,刚才只是更新了一下配置后,所有文章都被现实更新时间为本次(
hexo g -d
) 的日期了,但其实,大多数文章,是没有更新日期了,容易误导看客The text was updated successfully, but these errors were encountered: