Home / Function/ getStaticPaths() — astro Function Reference

getStaticPaths() — astro Function Reference

Architecture documentation for the getStaticPaths() function in [id].json.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  110a0241_9aab_1f35_4a6a_12403ad7df35["getStaticPaths()"]
  98478838_d69d_25f8_4a51_e14e94cabef4["[id].json.js"]
  110a0241_9aab_1f35_4a6a_12403ad7df35 -->|defined in| 98478838_d69d_25f8_4a51_e14e94cabef4
  style 110a0241_9aab_1f35_4a6a_12403ad7df35 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/test/fixtures/data-collections/src/pages/authors/[id].json.js lines 3–7

export async function getStaticPaths() {
	const collection = await getCollection('authors');

	return collection.map(({ id }) => ({ params: { id } }));
}

Subdomains

Frequently Asked Questions

What does getStaticPaths() do?
getStaticPaths() is a function in the astro codebase, defined in packages/astro/test/fixtures/data-collections/src/pages/authors/[id].json.js.
Where is getStaticPaths() defined?
getStaticPaths() is defined in packages/astro/test/fixtures/data-collections/src/pages/authors/[id].json.js at line 3.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free