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

增加新的文章详情页访问规则或允许用户自定义 #7013

Open
3 tasks done
QingFeng-awa opened this issue Nov 8, 2024 · 1 comment
Open
3 tasks done
Labels
area/core Issues or PRs related to the Halo Core area/ui Issues or PRs related to the Halo UI kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@QingFeng-awa
Copy link

前置条件

  • 已经在 Issues 列表中搜索了相关问题。
  • 这是和 Halo 相关的特性,如果是非项目本身的问题,建议在 Discussions 提交。
  • 如果是插件和主题特性建议,请在对应的插件和主题仓库提交。

你当前使用的版本

2.20.8

描述一下此特性

增加更多文章详情页访问规则或允许用户自定义。
我这里希望加的有:

  • /tags/slug
  • /categories/slug
  • /tags/name
  • /categories/name
  • /year/name
  • /y/m/name
  • /y/m/d/name
  • /slug (其实可以用页面代替,但某些主题页面和文章渲染效果不同因此不希望用这种方法解决)
  • /name

或者可以做一个自定义选项,包含:

  • 标签
  • 分类
  • 别名
  • 名称
  • 日期
  • UUID
  • ShortUUID

你们完全可以用2.20(看起来是新增的)组件:
Image
这张图是从Nexus 知识库主题的页脚配置那块截的,目前我看好几个主题都在用这个做菜单配置。

谁说这想法孬啊,这想法太棒了(doge)

附加信息

@guqing#3477 提到了后续有考虑支持自定义路由, #5284 #5916 也有同想法。
但看起来都不了了之了,所以我在这重提一下。

@ruibaby ruibaby added kind/feature Categorizes issue or PR as related to a new feature. area/core Issues or PRs related to the Halo Core priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. area/ui Issues or PRs related to the Halo UI labels Nov 11, 2024
@guqing
Copy link
Member

guqing commented Nov 11, 2024

这需要在 console 端提供一个路由编辑的界面让用户输入,但这种设置又不常使用,基本上只会设置一次将不在变更否则全是死链,目前你可以通过 API 修改
api/v1alpha1/configmaps/system

{
  "routeRules": "{\"categories\":\"categories\",\"archives\":\"archives\",\"post\":\"/archives/{slug}\",\"tags\":\"tags\"}",
}

其中 post 为文章路由,你可以参考 Halo 路由设置文章支持的参数来组合。

该 issue 提到的问题暂时不会实现,Halo 2.20 已经进入 LTS 不会在加新功能,会在下一个大版本考虑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues or PRs related to the Halo Core area/ui Issues or PRs related to the Halo UI kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

No branches or pull requests

3 participants