Skip to content

Add getStaticPaths for dynamic SSG route generation - #7

Merged
JoviDeCroock merged 1 commit into
mainfrom
JoviDeCroock/ssg-path-gen
Apr 7, 2026
Merged

Add getStaticPaths for dynamic SSG route generation#7
JoviDeCroock merged 1 commit into
mainfrom
JoviDeCroock/ssg-path-gen

Conversation

@JoviDeCroock

Copy link
Copy Markdown
Owner

Summary

  • Replaces prerender() with getStaticPaths() on route modules — returns RouteParams[] instead of full path strings, decoupling route modules from their URL patterns
  • Adds buildPathFromSegments() helper that constructs full paths from route segments + params at build time
  • Adds a /products/:productId dynamic SSG example route to the basic example app
  • E2E test verifies dynamic SSG routes produce static HTML files and serve correctly
  • Updates all docs, example docs, and skill files to reflect the new API

Test plan

  • Unit tests pass (16/16)
  • E2E node-build test verifies prerendered HTML files exist for /products/1, /products/2, /products/3
  • E2E node-build test verifies the server serves dynamic SSG pages with correct content

🤖 Generated with Claude Code

Replace prerender() with getStaticPaths() so route modules return param
objects instead of full paths, decoupling them from URL patterns.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JoviDeCroock
JoviDeCroock merged commit c3b98fe into main Apr 7, 2026
1 check passed
@JoviDeCroock
JoviDeCroock deleted the JoviDeCroock/ssg-path-gen branch April 8, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant