User story
As a user building a static site with Webstudio and a headless CMS (Directus), I want the SSG template to automatically pre-render dynamic routes based on attached Resources, natively handle 404.html, and process SEO/redirect files for static deployment, so that I don't have to write custom patch scripts.
Summary
Propose universal SSG rendering improvements for dynamic sites with headless CMS.
What the agent tried
- Export project using --template ssg
- Observe missing dynamic routes in generated static files
Expected behavior
- Path Parameter Sources: Add a setting to allow assigning a Resource (API) as the Path Provider for dynamic routes. The CLI could automatically generate an
+onBeforePrerenderStart.ts hook for Vike to fetch the slugs during build. 2. Native 404: Map Webstudio's catch-all route (app/__generated__/$.tsx) to Vike's pages/_error route to output a standard 404.html. 3. Support generating non-HTML assets (sitemap.xml) and parse $resources.redirects.ts into a _redirects file for Cloudflare Pages during the build step.
Actual result
Currently, --template ssg only pre-renders static HTML files. Dynamic routes (e.g. /tattoo/@slug) populated by CMS connections are ignored because the compiler does not fetch slugs at build time. SEO files (sitemap.xml, llms.txt, _redirects) and 404 pages are skipped or not properly generated for static deployment like Cloudflare Pages.
Recovery attempts
- Created custom patch-ssg-routes.js script to dynamically inject Vike folders and onBeforePrerenderStart.ts hooks
- Created custom generate-static-xml.js to handle sitemap and redirects
User impact
High friction and manual script writing required to deploy fully functional static sites from dynamic CMS data.
Technical context
Webstudio Vike SSG template lacks native support for fetching dynamic paths at build time from attached Resources, requiring manual workarounds.
Agent environment
- Client: antigravity
- Provider: unknown
- Model: gemini
- Reasoning effort: unknown
- Trigger: user-requested
- Category: feature-request
Technical runtime
- CLI: 0.291.0
- Node.js: 24.18.0
- Operating system: win32 10 (x64)
- Execution mode: mcp
- API contract: public-api:iqd6ok
Acceptance criteria
- Add UI setting for Path Parameter Sources
- Automatically generate onBeforePrerenderStart.ts hook for dynamic routes
- Map catch-all route to _error for 404 generation
- Support generating non-HTML files and _redirects
User story
As a user building a static site with Webstudio and a headless CMS (Directus), I want the SSG template to automatically pre-render dynamic routes based on attached Resources, natively handle 404.html, and process SEO/redirect files for static deployment, so that I don't have to write custom patch scripts.
Summary
Propose universal SSG rendering improvements for dynamic sites with headless CMS.
What the agent tried
Expected behavior
+onBeforePrerenderStart.tshook for Vike to fetch the slugs during build. 2. Native 404: Map Webstudio's catch-all route (app/__generated__/$.tsx) to Vike'spages/_errorroute to output a standard404.html. 3. Support generating non-HTML assets (sitemap.xml) and parse$resources.redirects.tsinto a_redirectsfile for Cloudflare Pages during the build step.Actual result
Currently,
--template ssgonly pre-renders static HTML files. Dynamic routes (e.g./tattoo/@slug) populated by CMS connections are ignored because the compiler does not fetch slugs at build time. SEO files (sitemap.xml, llms.txt, _redirects) and 404 pages are skipped or not properly generated for static deployment like Cloudflare Pages.Recovery attempts
User impact
High friction and manual script writing required to deploy fully functional static sites from dynamic CMS data.
Technical context
Webstudio Vike SSG template lacks native support for fetching dynamic paths at build time from attached Resources, requiring manual workarounds.
Agent environment
Technical runtime
Acceptance criteria