Skip to content
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

page.prev和page.next获取的值相反 #288

Closed
4 of 6 tasks
i2Echo opened this issue Apr 14, 2017 · 8 comments
Closed
4 of 6 tasks

page.prev和page.next获取的值相反 #288

i2Echo opened this issue Apr 14, 2017 · 8 comments

Comments

@i2Echo
Copy link

i2Echo commented Apr 14, 2017

I certify that I have first consulted (check all with "x")

我确认我已经查看了 (使用 "x" 选择)


I'm submitting a (check one with "x")

我正在申请 (使用 "x" 选择)

  • bug report | 反馈一个 bug
  • feature request | 申请添加新的特性或功能
  • support request | 请求技术支持

使用本主题后,翻页上一篇下一篇正好相反(按时间排序),即prev为旧的时间节点文章,next为新的时间节点文章了,按照正常习惯是prev为新的时间节点文章,next为旧的时间节点。我暂时是将post-nav.ejs文件下的顺序换过来,但是我看hexo文档是按照正常顺序(page.prev获取上一篇【新】,page.next获取下一篇【旧】)来的没错的,不知道为什么我的会出现相反的现象,还有顺便问一下如何去调试hexo的这些变量,谢谢!

@EYHN
Copy link
Contributor

EYHN commented Apr 14, 2017

hexojs/hexo#2474

Line 2, var posts = locals.posts.sort('-date').toArray();, is wrong, which will generator a reversed list.
I try to use npm update or npm update -g, but the bug didn't disappear.
So I think it is the package error. And I check other's website. They are having the same problem

@neoFelhz
Copy link
Collaborator

Yep. It caused by hexo 3.2.2 or newer.

@NoahDragon
Copy link

hexojs/hexo#2474 hexojs/hexo#2262
It should be fixed in Hexo 3.3.1.

@Halyul
Copy link

Halyul commented Apr 15, 2017

@NoahDragon but last night I have tested on hexo 3.3.1, it seems that the issue is still there

@NoahDragon
Copy link

@Halyul you are right, seem the fix is not working.

@i2Echo
Copy link
Author

i2Echo commented Apr 16, 2017

@NoahDragon yeap, is to updated the hexo to the latest version 3.3.1, that the issue was happend.

@NoahDragon
Copy link

NoahDragon commented Apr 20, 2017

The issue may cause by the sort fix hexojs/hexo#2262. All the changes have reverted hexojs/hexo#2526

@neoFelhz
Copy link
Collaborator

neoFelhz commented May 1, 2017

I have just updated the hexo to 3.3.5 and found the problem solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants