Structured Data
Document
The core MDXLD document structure combining frontmatter with content
The MDXLDDocument is the fundamental unit of content in MDX.org.ai. It combines structured YAML-LD frontmatter with MDX content body.
Structure
Frontmatter Data
The data field contains parsed YAML frontmatter with special LD properties:
Example Document
Parsing & Stringifying
Type-Safe Documents
Use TypedData for strongly-typed frontmatter:
Extended Document Types
Documents can be extended with additional data:
| Type | Description |
|---|---|
MDXLDDocumentWithAST | Includes parsed MDX AST |
MDXLDDocumentWithCode | Includes compiled JavaScript |
MDXLDDocumentWithRelationships | Includes extracted links and references |
MDXLDDocumentFull | All extensions combined |
With AST
With Relationships
JSON-LD Compatibility
MDXLD frontmatter maps directly to JSON-LD:
| MDXLD | JSON-LD | Description |
|---|---|---|
$type | @type | Type discriminator |
$id | @id | Resource identifier |
$context | @context | Vocabulary context |
Convert to JSON-LD: