Home / Function/ parseEntrySlug() — astro Function Reference

parseEntrySlug() — astro Function Reference

Architecture documentation for the parseEntrySlug() function in utils.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  cee93cfc_797d_10f9_7ee1_711ec98a59da["parseEntrySlug()"]
  7a09e708_c090_71c0_8138_7343699b1865["utils.ts"]
  cee93cfc_797d_10f9_7ee1_711ec98a59da -->|defined in| 7a09e708_c090_71c0_8138_7343699b1865
  1ed6fe42_279b_7827_1f5b_d69952bde3cc["getEntrySlug()"]
  1ed6fe42_279b_7827_1f5b_d69952bde3cc -->|calls| cee93cfc_797d_10f9_7ee1_711ec98a59da
  style cee93cfc_797d_10f9_7ee1_711ec98a59da fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/content/utils.ts lines 133–152

export function parseEntrySlug({
	id,
	collection,
	generatedSlug,
	frontmatterSlug,
}: {
	id: string;
	collection: string;
	generatedSlug: string;
	frontmatterSlug?: unknown;
}) {
	try {
		return z.string().default(generatedSlug).parse(frontmatterSlug);
	} catch {
		throw new AstroError({
			...AstroErrorData.InvalidContentEntrySlugError,
			message: AstroErrorData.InvalidContentEntrySlugError.message(collection, id),
		});
	}
}

Subdomains

Called By

Frequently Asked Questions

What does parseEntrySlug() do?
parseEntrySlug() is a function in the astro codebase, defined in packages/astro/src/content/utils.ts.
Where is parseEntrySlug() defined?
parseEntrySlug() is defined in packages/astro/src/content/utils.ts at line 133.
What calls parseEntrySlug()?
parseEntrySlug() is called by 1 function(s): getEntrySlug.

Analyze Your Own Codebase

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

Try Supermodel Free