Array of static paths to be generated at build time.
This type represents the collection of all route configurations that should be pre-rendered for a dynamic route.
type
Array of static paths to be generated at build time.
This type represents the collection of all route configurations that should be pre-rendered for a dynamic route.
// Array of blog post paths
const blogPaths: SSGPaths<{ slug: string }> = [
{ params: { slug: "introduction-to-bun" } },
{ params: { slug: "performance-benchmarks" } },
{ params: { slug: "getting-started-guide" } }
];
// Mixed parameter types
const productPaths: SSGPaths<{ category: string; id: string }> = [
{ params: { category: "books", id: "javascript-guide" } },
{ params: { category: "electronics", id: "smartphone-x" } }
];
Configuration object for a single static route to be generated.
Each path object contains the parameters needed to render a specific instance of a dynamic route at build time.
// Single blog post path
const blogPath: SSGPath<{ slug: string }> = {
params: { slug: "my-first-post" }
};
// Product page with multiple params
const productPath: SSGPath<{ category: string; id: string }> = {
params: {
category: "electronics",
id: "laptop-123"
}
};
// Documentation with catch-all route
const docsPath: SSGPath<{ path: string[] }> = {
params: { path: ["getting-started", "installation"] }
};