-
Heo 主题右侧的 "最新发布" 是按修改时间排列的, 如何能让其按文章的创建时间来排列呢 ? |
Beta Was this translation helpful? Give feedback.
Answered by
Daleveral
Dec 5, 2024
Replies: 1 comment
-
相关代码是 const dateA = new Date(a?.lastEditedDate || a?.publishDate)
const dateB = new Date(b?.lastEditedDate || b?.publishDate) 改为 : const dateA = new Date(a?.publishDate)
const dateB = new Date(b?.publishDate) 如此就能安装发布时间排列, 当然还要修改显示的时间 : 在
将 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
larevelad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关代码是
lib/db/getSiteData.js
中 latestPosts 函数处, 有 :改为 :
如此就能安装发布时间排列, 当然还要修改显示的时间 :
在
themes/heo/components/LatestPostsGroupMini.js
文件的末尾有 :<div className='text-gray-400'>{post.lastEditedDay}</div>
将
post.lastEditedDay
改为post?.publishDay
即可