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

[ Gitbook 主题 ] 文档自动分组排序功能使用,siteConfig无效 #2412

Closed
W4ddl3 opened this issue May 14, 2024 · 2 comments · Fixed by #2414
Closed

[ Gitbook 主题 ] 文档自动分组排序功能使用,siteConfig无效 #2412

W4ddl3 opened this issue May 14, 2024 · 2 comments · Fixed by #2414
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@W4ddl3
Copy link

W4ddl3 commented May 14, 2024

描述bug

NEXT_PUBLIC_GITBOOK_AUTO_SORT 设置为 false 时不起作用

GITBOOK_AUTO_SORT: process.env.NEXT_PUBLIC_GITBOOK_AUTO_SORT || true, // 是否自动按分类名 归组排序文章;自动归组可能会打乱您Notion中的文章顺序

如下图是我的 Notion 列表
Shot 2024-05-14 at 12 04 17

可以看到理论排序应该是
快速了解
产品定价
部署指南
页面介绍
联系我们

如下图是实际部署的效果
Shot 2024-05-14 at 12 06 09

可以看到实际排序是
快速了解
产品定价
联系我们
部署指南
页面介绍

也就是它和 NEXT_PUBLIC_GITBOOK_AUTO_SORT 设置为 true 时 一样,把分类的放到最下面,单页放到最上面

即,NEXT_PUBLIC_GITBOOK_AUTO_SORT 这个参数设置为 false 时已失效

期望的正常结果
无须多言

复现步骤
半个月前的版本是没问题的,前几天我更新了一下代码,就不起作用了

环境

  • 【必填】NotionNext版本 [ 4.5.2 ]
  • 【必填】主题 [ Gitbook ]
  • 【必填】部署方案 [ Vercel ]
@W4ddl3 W4ddl3 added the bug Something isn't working label May 14, 2024
@W4ddl3
Copy link
Author

W4ddl3 commented May 14, 2024

奥,我想起来。是这个变量本来就没用

我之前是把这里的 true 改成 false 才达到目的的

if (siteConfig('GITBOOK_AUTO_SORT', true, CONFIG)) {

@tangly1024 tangly1024 added the help wanted Extra attention is needed label May 15, 2024
@tangly1024 tangly1024 changed the title [ Gitbook 主题 ] 最新版本 NEXT_PUBLIC_GITBOOK_AUTO_SORT 功能失效 [ Gitbook 主题 ] 文档自动分组排序功能使用 May 15, 2024
@tangly1024 tangly1024 changed the title [ Gitbook 主题 ] 文档自动分组排序功能使用 [ Gitbook 主题 ] 文档自动分组排序功能使用,siteConfig无效 May 15, 2024
@tangly1024
Copy link
Owner

tangly1024 commented May 15, 2024

感谢反馈,经过代码排查确实发现配置无效,并且顺藤摸瓜发现一个影响范围比较广的重大bug。很快会提交补丁修复

更新代码后,可使用环境变量NEXT_PUBLIC_GITBOOK_AUTO_SORT或者在Notion中添加Config-GITBOOK_AUTO_SORT实现:

image

@tangly1024 tangly1024 added the good first issue Good for newcomers label May 15, 2024
@tangly1024 tangly1024 linked a pull request May 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants