web-infra-dev / rspress

🦀💨 A fast Rspack-based static site generator.
https://rspress.dev
MIT License
1.43k stars 132 forks source link

[Feature]: Do we support dynamic routing? #1368

Open bosens-China opened 2 months ago

bosens-China commented 2 months ago

这个功能解决了什么问题?

有一些很重复的场景,可能只是内容不同,其他都是相同的,如果能暴露一个动态路由,可以通过编程式的来处理所有数据这就太完美了。

你期望的 API 是什么样子的?

在docs文件下创建类似于 :id的文件夹表示这个是一个动态组件,在文件夹内创建 index.tsx等文件,接收一个props包含id,这样就可以批量处理了。

Timeless0911 commented 2 months ago

Rspress just like many similar frameworks, is a static site generator that uses file-based convention routing. You can try using Modern.js or other frameworks to build your own document site to meet these dynamic requirements.

Timeless0911 commented 2 months ago

This feature can be implemented into Rspress, but we don't have plans to do now. If you are interested, you can contribute a PR. FYI: https://vitepress.dev/guide/routing#dynamic-routes

bosens-China commented 2 months ago

@Timeless0911 如果我在其他框架,例如next能直接使用你们的ui吗?就是默认的主题,跟我现在在rspress看到的一致

Timeless0911 commented 2 months ago

这当然不能了

bosens-China commented 2 months ago

这当然不能了

😃没办法支持吗

Timeless0911 commented 2 months ago

Not our goal and if you are interest, you can contribute a PR.

bosens-China commented 2 months ago

老哥业务太多了,实在没办法贡献呀😄