# Sitebase Lexicons Sitebase defines its own lexicons under the `pub.sitebase.*` namespace for content types and draft handling. ## Why Custom Lexicons? The `site.standard.document` schema defines `content` as an open union, allowing different services to define their own content type schemas. Each service (leaflet, pckt.blog, sitebase) uses their own namespaced types. Sitebase needs custom lexicons for: 1. **Content types** - markdown and HTML content with proper structure 2. **Drafts** - standard.site doesn't have a draft concept; we need our own ## Lexicon Definitions ### `pub.sitebase.content.markdown` Markdown content for documents. ```json { "lexicon": 1, "id": "pub.sitebase.content.markdown", "defs": { "main": { "type": "object", "required": ["markdown"], "properties": { "markdown": { "type": "string", "description": "The markdown content" } } } } } ``` **Usage in document:** ```json { "$type": "site.standard.document", "title": "My Post", "content": { "$type": "pub.sitebase.content.markdown", "markdown": "# Hello\n\nThis is my post." } } ``` ### `pub.sitebase.content.html` HTML content for documents. ```json { "lexicon": 1, "id": "pub.sitebase.content.html", "defs": { "main": { "type": "object", "required": ["html"], "properties": { "html": { "type": "string", "description": "The HTML content" } } } } } ``` ### `pub.sitebase.draft` Draft document storage. Drafts are stored separately from published documents. ```json { "lexicon": 1, "id": "pub.sitebase.draft", "defs": { "main": { "type": "record", "key": "tid", "description": "A draft document that hasn't been published yet", "record": { "type": "object", "required": ["title", "content", "createdAt"], "properties": { "site": { "type": "string", "format": "at-uri", "description": "AT URI of the publication this draft belongs to" }, "title": { "type": "string", "description": "Draft title" }, "path": { "type": "string", "description": "Intended URL path when published" }, "description": { "type": "string", "description": "Short description or excerpt" }, "content": { "type": "union", "refs": [ "pub.sitebase.content.markdown", "pub.sitebase.content.html" ], "description": "Draft content" }, "tags": { "type": "array", "items": { "type": "string" }, "description": "Tags for categorization" }, "createdAt": { "type": "string", "format": "datetime", "description": "When the draft was created" }, "updatedAt": { "type": "string", "format": "datetime", "description": "When the draft was last updated" } } } } } } ``` ## Publishing Lexicons Lexicons should be published to the PDS at: - `at:///com.atproto.lexicon.schema/pub.sitebase.content.markdown` - `at:///com.atproto.lexicon.schema/pub.sitebase.content.html` - `at:///com.atproto.lexicon.schema/pub.sitebase.draft` The DID should be the sitebase project's identity (associated with pub.sitebase domain).