vitepress-sidebar icon indicating copy to clipboard operation
vitepress-sidebar copied to clipboard

Problem with Dynamic Routes

Open SasePriv opened this issue 9 months ago • 4 comments

Describe the bug

In Vitepress exist the posibility to generate dinamic routes from dynamic data, in my case im using this to generate pages with data is comming from api, and in the documentation of vitepress, say the output will be new html files with that data.

I understand that the vitepress sidebar automatically scans each file and generates the sidebar, but in my case in the sidebar only the .md file of the template is shown.

Image

I think this is a bug or a behavior that has not yet been taken into account in this project.

Expected behavior

The normal behavior would be that it should show the dynamic routes in the sidebar.

Your environment - System OS

Ubuntu under WSL on Windows 11

Your environment - Web Browser

Brave

SasePriv avatar Feb 10 '25 13:02 SasePriv

Hello, thank you for using vitepress-sidebar.

Yes, this is a feature that is not yet implemented in our plugin. Thank you for reporting the issue!

I'll take a look at it as soon as I have some free time, but I'll keep the issue open until then as it may be delayed. I'll update the information when the feature is implemented.

Thanks again!

jooy2 avatar Feb 11 '25 02:02 jooy2

If it's ok with you and you haven't started yet and this feature won't be done soon, I could participate and make a pull request with the feature ? @jooy2

SasePriv avatar Feb 11 '25 09:02 SasePriv

Of course! Contributions to the project are always welcome :)

I'll be working on #198 for the time being, as it's a high priority issue. However, as soon as PRs come in, I can quickly review and merge them.

When contributing to the project, you may need to consider the project's documentation, test code, or option scheme.

Regards,

jooy2 avatar Feb 11 '25 09:02 jooy2

I was thinking on reading the .paths.js file to generate the links, but i found some problems on the road, first the problem to find .ts files that the compiled code will throw an error, then to make dynamic importing of the .paths.js is async and i see the all code is made to do it in sync.

Some idea how it can do it

SasePriv avatar Feb 11 '25 13:02 SasePriv