Candinya / Kratos-Rebirth

一个可爱而现代的 Hexo 主题
GNU General Public License v3.0
630 stars 80 forks source link

[Low Priority] "指定文章显示的位置" 功能未能正常处理分页 #134

Open ghost opened 2 years ago

ghost commented 2 years ago
  1. 对Bug的描述:

指定文章显示的位置 功能未能正常处理分页

在使用此功能且 总文章数量>分页最低文章数量 时, pagination 依旧按照总文章数量进行分页, 仅在每个分页上对相应的文章进行了隐藏处理 此bug可导致终端用户轻易发现博客有被隐藏的文章

  1. 复现Bug的方法:

简单的演示 此Repo模拟了一个需要分页的博客, 并随机挑选了几个文章设置了 指定文章显示的位置 运行 hexo clean all && hexo g && hexo s 并访问 http://localhost:4000 即可发现此异常行为

  1. 期望的行为:

设置此功能后, 相关页面应按照隐藏后的文章列表进行分页, 每页显示的文章数量也应符合设置

  1. 运行环境(如果该Bug的产生和环境有关,例如浏览器不兼容导致):
OS: Archlinux Rolling
Node: 16.15.1
Npm: 8.12.1
Yarn: 1.22.19
Hexo-cli: 4.3.0
Hexo-theme-kratos-rebirth: 2.0.3
Candinya commented 2 years ago

可能暂时无解,因为 only 是一个主题自定义参数,而分页目前主题调用的是 hexo-generator-index 这个组件生成的分页数据,那边暂时没有兼容这里的这种自定义参数 (但是可以创建一个 fork 魔改一下,记到小本本上x

ghost commented 2 years ago

也许可能有关的issue: https://github.com/hexojs/hexo-generator-index/issues/14 https://github.com/hexojs/hexo-generator-index/issues/60 应该是要动上游模块了orz 暂时搁置(

ArcticLampyrid commented 2 years ago

应该是要动上游模块了orz 暂时搁置(

next主题那边好像确实是自己fork了个index生成器 https://github.com/next-theme/hexo-generator-indexed/blob/9fc4c10772ef591112662035d0dd7de30ba7a38c/lib/generator.js#L9-L21