Dynamic Routes

Handle dynamic values in URLs by using folders that start with an underscore.

Dynamic Routes

Folders prefixed with an underscore (e.g. _slug) capture path parameters from the URL.

routes/blog/_slug/index.html      →   /blog/my-first-post
routes/user/_id/index.html        →   /user/42
routes/product/_sku/index.html    →   /product/abc-123

The dynamic value is passed into your server logic via the params map:

slug := params["slug"]

Dynamic routes are useful for blog posts, user profiles, or any content-driven paths. Combine them with server files to generate custom output.