vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
12.79k stars 2.07k forks source link

Dynamic routes/pages not visible in `local` search #2939

Open lukasberbuer opened 1 year ago

lukasberbuer commented 1 year ago

Describe the bug

Dynamic routes/pages are not visible with the local search. Is there any way to manually add dynamic content to be searchable?

Reproduction

Similar setup as in documentation: https://vitepress.dev/guide/routing#dynamic-routes

Expected behavior

Search finds dynamic generated pages.

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
    Memory: 5.22 GB / 15.79 GB
  Binaries:
    Node: 18.16.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.15.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 116.0.5845.180
    Edge: Spartan (44.22621.2215.0), Chromium (116.0.1938.76)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vitepress: ^1.0.0-rc.12 => 1.0.0-rc.12

Additional context

No response

Validations

brc-dd commented 1 year ago

This isn't supported yet. For this to work, the search plugin would need to run after the html of all the pages is generated. You can try some third party plugin like https://www.npmjs.com/package/vitepress-plugin-pagefind instead.

Karlstens commented 3 months ago

I can confirm that PageFind and vitepress-plugin-pagefind plugin work with VitePress Dynamic Routes.