Skip to content

关于 Heo 的 "最新发布" 的排列方法 #3037

Answered by Daleveral
larevelad asked this question in Q&A
Discussion options

You must be logged in to vote

相关代码是 lib/db/getSiteData.js 中 latestPosts 函数处, 有 :

    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)

如此就能安装发布时间排列, 当然还要修改显示的时间 :

themes/heo/components/LatestPostsGroupMini.js 文件的末尾有 :

<div className='text-gray-400'>{post.lastEditedDay}</div>

post.lastEditedDay 改为 post?.publishDay 即可

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by larevelad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants