LoveIt
LoveIt copied to clipboard
[BUG] posts on homepage are not sorted in the order of creation date (latest to oldest)
Describe the bug 描述你遇到的错误
The posts appear on home page are not sorted by latest to oldest
Expected behavior 期待的行为
New posts should appear on top
Screenshots 屏幕截图
Build Environment 构建环境
- OS: [e.g. Windows 10, macOS, Ubuntu]
- Theme version/commit [latest]
- Hugo version [latest]
Please try to use Hugo extended version before opening the issue
Preview Environment
Additional Information 补充信息
Configuration files or front matter code... 配置文件或者前置参数的代码...
I am having the same problem but doesn't look like the author is responding to any of the bugs or queries.
I am having the same problem but doesn't look like the author is responding to any of the bugs or queries.
I fixed it by myself.
Can you share your fix please?
Can you share your fix please?
In layouts/index.html, modify the line where it displays posts to:
{{- range $pages.Pages.ByDate.Reverse -}}
Fantastic!....thank you so much for sharing.
Can you share your fix please?
In layouts/index.html, modify the line where it displays posts to:
{{- range $pages.Pages.ByDate.Reverse -}}
This is looking good, you can do PR for it
Edited: Anyway, I have no problem about this. I have tried to replace my oldest posts with the newest date and it will always be attached to the newest posts.