this repo has no description
1# Sitebase Lexicons
2
3Sitebase defines its own lexicons under the `pub.sitebase.*` namespace for content types and draft handling.
4
5## Why Custom Lexicons?
6
7The `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.
8
9Sitebase needs custom lexicons for:
10
111. **Content types** - markdown and HTML content with proper structure
122. **Drafts** - standard.site doesn't have a draft concept; we need our own
13
14## Lexicon Definitions
15
16### `pub.sitebase.content.markdown`
17
18Markdown content for documents.
19
20```json
21{
22 "lexicon": 1,
23 "id": "pub.sitebase.content.markdown",
24 "defs": {
25 "main": {
26 "type": "object",
27 "required": ["markdown"],
28 "properties": {
29 "markdown": {
30 "type": "string",
31 "description": "The markdown content"
32 }
33 }
34 }
35 }
36}
37```
38
39**Usage in document:**
40
41```json
42{
43 "$type": "site.standard.document",
44 "title": "My Post",
45 "content": {
46 "$type": "pub.sitebase.content.markdown",
47 "markdown": "# Hello\n\nThis is my post."
48 }
49}
50```
51
52### `pub.sitebase.content.html`
53
54HTML content for documents.
55
56```json
57{
58 "lexicon": 1,
59 "id": "pub.sitebase.content.html",
60 "defs": {
61 "main": {
62 "type": "object",
63 "required": ["html"],
64 "properties": {
65 "html": {
66 "type": "string",
67 "description": "The HTML content"
68 }
69 }
70 }
71 }
72}
73```
74
75### `pub.sitebase.draft`
76
77Draft document storage. Drafts are stored separately from published documents.
78
79```json
80{
81 "lexicon": 1,
82 "id": "pub.sitebase.draft",
83 "defs": {
84 "main": {
85 "type": "record",
86 "key": "tid",
87 "description": "A draft document that hasn't been published yet",
88 "record": {
89 "type": "object",
90 "required": ["title", "content", "createdAt"],
91 "properties": {
92 "site": {
93 "type": "string",
94 "format": "at-uri",
95 "description": "AT URI of the publication this draft belongs to"
96 },
97 "title": {
98 "type": "string",
99 "description": "Draft title"
100 },
101 "path": {
102 "type": "string",
103 "description": "Intended URL path when published"
104 },
105 "description": {
106 "type": "string",
107 "description": "Short description or excerpt"
108 },
109 "content": {
110 "type": "union",
111 "refs": [
112 "pub.sitebase.content.markdown",
113 "pub.sitebase.content.html"
114 ],
115 "description": "Draft content"
116 },
117 "tags": {
118 "type": "array",
119 "items": { "type": "string" },
120 "description": "Tags for categorization"
121 },
122 "createdAt": {
123 "type": "string",
124 "format": "datetime",
125 "description": "When the draft was created"
126 },
127 "updatedAt": {
128 "type": "string",
129 "format": "datetime",
130 "description": "When the draft was last updated"
131 }
132 }
133 }
134 }
135 }
136}
137```
138
139## Publishing Lexicons
140
141Lexicons should be published to the PDS at:
142
143- `at://<did>/com.atproto.lexicon.schema/pub.sitebase.content.markdown`
144- `at://<did>/com.atproto.lexicon.schema/pub.sitebase.content.html`
145- `at://<did>/com.atproto.lexicon.schema/pub.sitebase.draft`
146
147The DID should be the sitebase project's identity (associated with pub.sitebase domain).