Skip to content

Commit 62b8f3f

Browse files
committed
feat: schema optimization
Reviewed all 27 block schemas in modules/blox/blox against their block.html implementations and applied best-practice optimizations. Here's what was updated: Schemas Updated with New Properties Schema Changes cta-button-list Added label, name, link aliases; added new_tab boolean; changed required to anyOf for flexibility dev-hero Added content as required; added design.animations boolean faq Added title/text aliases for items; added padding_sm and defaults to spacing arrays knowledge-categories Added link field per category item; added minimum: 0 for count portfolio Added design.animations boolean; added sort_by enum tech-stack Added design.animations boolean Schemas Updated with Improved Descriptions & Enums Schema Improvements collection Added sort_by enum; improved view description; changed columns to integer with min/max constraints resume-experience Added $comment documenting author profile fields (button, tags, etc.) resume-skills Added $comment documenting skill group structure resume-awards Added $comment documenting award item fields resume-languages Added $comment documenting language level conversions resume-biography Enhanced avatar size description with pixel values resume-biography-3 Enhanced avatar/name size descriptions stats Improved statistic description with formatting examples hero Clarified no_padding description with Tailwind classes logos Enhanced display_mode description with layout behaviors research-areas Enhanced layout description with style explanations team-showcase Added sort_by enum with common values search-hero Added examples array for suggestions testimonials Added image processing note and examples cta-image-paragraph Added responsive image processing note features Enhanced icon description with pack formats and examples Schemas Already Well-Aligned These schemas were already in good shape and required no changes: contact-info, cta-card, hero, markdown, stats, testimonials, trending-questions Notes New alias fields (label/name/link in buttons, title/text in FAQ items) provide backward compatibility with alternate naming conventions used in templates The $comment fields document author profile data structures that aren't directly in the schema but are consumed by resume blocks
1 parent 09eb7f7 commit 62b8f3f

File tree

23 files changed

+203
-60
lines changed

23 files changed

+203
-60
lines changed

modules/blox/blox/collection/schema.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
},
4545
"sort_by": {
4646
"type": "string",
47-
"description": "Field to sort by (e.g., Date, title, weight, lastmod)",
47+
"description": "Field to sort by",
48+
"enum": ["Date", "date", "Title", "title", "Weight", "weight", "Lastmod", "lastmod", "PublishDate", "publishdate"],
4849
"default": "Date"
4950
},
5051
"sort_ascending": {
@@ -155,12 +156,14 @@
155156
"view": {
156157
"type": "string",
157158
"enum": ["card", "compact", "showcase", "citation", "list", "masonry", "article-grid", "date-title-summary", "slides-gallery"],
158-
"description": "Display view type",
159+
"description": "Display view type. 'card' shows full cards with images, 'compact' shows minimal list items, 'showcase' highlights featured content, 'citation' for academic publications, 'article-grid' for blog layouts.",
159160
"default": "card"
160161
},
161162
"columns": {
162-
"type": ["integer", "string"],
163-
"description": "Number of columns when using grid-based views",
163+
"type": "integer",
164+
"description": "Number of columns when using grid-based views (1-4)",
165+
"minimum": 1,
166+
"maximum": 4,
164167
"default": 2
165168
},
166169
"fill_image": {

modules/blox/blox/contact-info/schema.json

Lines changed: 86 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
"type": "string",
2828
"description": "Section subtitle"
2929
},
30+
"username": {
31+
"type": "string",
32+
"description": "Author username to pull fallback contact details from",
33+
"default": "me"
34+
},
3035
"visit_title": {
3136
"type": "string",
3237
"description": "Title for the visit section",
@@ -37,26 +42,52 @@
3742
"description": "Title for the connect section",
3843
"default": "Connect"
3944
},
45+
"text": {
46+
"type": "string",
47+
"description": "Connect section intro text"
48+
},
4049
"address": {
41-
"type": "object",
4250
"description": "Physical address information",
43-
"properties": {
44-
"lines": {
51+
"oneOf": [
52+
{
53+
"type": "string",
54+
"description": "Single-line address"
55+
},
56+
{
57+
"type": "object",
58+
"properties": {
59+
"lines": {
60+
"description": "Address lines",
61+
"oneOf": [
62+
{
63+
"type": "array",
64+
"items": {
65+
"type": "string"
66+
}
67+
},
68+
{
69+
"type": "string"
70+
}
71+
]
72+
}
73+
},
74+
"additionalProperties": false
75+
}
76+
]
77+
},
78+
"office_hours": {
79+
"description": "Office hours information",
80+
"oneOf": [
81+
{
4582
"type": "array",
46-
"description": "Address lines",
4783
"items": {
4884
"type": "string"
4985
}
86+
},
87+
{
88+
"type": "string"
5089
}
51-
},
52-
"additionalProperties": false
53-
},
54-
"office_hours": {
55-
"type": "array",
56-
"description": "Office hours information",
57-
"items": {
58-
"type": "string"
59-
}
90+
]
6091
},
6192
"email": {
6293
"type": "string",
@@ -68,23 +99,50 @@
6899
"description": "Contact phone number"
69100
},
70101
"social": {
71-
"type": "array",
72102
"description": "Social media links",
73-
"items": {
74-
"type": "object",
75-
"properties": {
76-
"icon": {
77-
"type": "string",
78-
"description": "Icon name (e.g., 'brands/x', 'brands/linkedin')"
79-
},
80-
"url": {
81-
"type": "string",
82-
"description": "Social media URL"
83-
}
103+
"oneOf": [
104+
{
105+
"type": "string",
106+
"description": "Single social link"
84107
},
85-
"required": ["icon", "url"],
86-
"additionalProperties": false
87-
}
108+
{
109+
"type": "array",
110+
"items": {
111+
"oneOf": [
112+
{
113+
"type": "string"
114+
},
115+
{
116+
"type": "object",
117+
"properties": {
118+
"icon": {
119+
"type": "string",
120+
"description": "Icon name (e.g., 'brands/x', 'brands/linkedin')"
121+
},
122+
"url": {
123+
"type": "string",
124+
"description": "Social media URL"
125+
},
126+
"link": {
127+
"type": "string",
128+
"description": "Alias for url"
129+
},
130+
"label": {
131+
"type": "string",
132+
"description": "Tooltip label"
133+
},
134+
"name": {
135+
"type": "string",
136+
"description": "Label alias"
137+
}
138+
},
139+
"anyOf": [{ "required": ["url"] }, { "required": ["link"] }],
140+
"additionalProperties": false
141+
}
142+
]
143+
}
144+
}
145+
]
88146
},
89147
"prospective": {
90148
"type": "object",

modules/blox/blox/cta-button-list/schema.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,39 @@
2727
"type": "string",
2828
"description": "Button label (supports Markdown)"
2929
},
30+
"label": {
31+
"type": "string",
32+
"description": "Alias for text"
33+
},
34+
"name": {
35+
"type": "string",
36+
"description": "Alias for text"
37+
},
3038
"url": {
3139
"type": "string",
3240
"description": "Button URL"
3341
},
42+
"link": {
43+
"type": "string",
44+
"description": "Alias for url"
45+
},
3446
"icon": {
3547
"type": "string",
3648
"description": "Optional leading icon (icon pack format: pack/icon-name)"
49+
},
50+
"new_tab": {
51+
"type": "boolean",
52+
"description": "Open link in a new tab (auto-detected for external URLs and PDFs)",
53+
"default": false
3754
}
3855
},
39-
"required": ["text", "url"],
56+
"anyOf": [
57+
{ "required": ["text"] },
58+
{ "required": ["label"] },
59+
{ "required": ["name"] },
60+
{ "required": ["url"] },
61+
{ "required": ["link"] }
62+
],
4063
"additionalProperties": false
4164
},
4265
"minItems": 1

modules/blox/blox/cta-image-paragraph/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
},
3434
"image": {
3535
"type": "string",
36-
"description": "Image filename in assets/media/",
37-
"examples": ["screenshots/product.png"]
36+
"description": "Image filename in assets/media/. Responsive images are generated automatically (400-1200px). GIFs are converted to webp.",
37+
"examples": ["screenshots/product.png", "features/demo.jpg"]
3838
},
3939
"feature_icon": {
4040
"type": "string",

modules/blox/blox/dev-hero/schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,17 @@
171171
"description": "Avatar shape",
172172
"enum": ["circle", "rounded"],
173173
"default": "circle"
174+
},
175+
"animations": {
176+
"type": "boolean",
177+
"description": "Enable scroll and typewriter animations",
178+
"default": false
174179
}
175180
},
176181
"additionalProperties": true
177182
}
178183
},
184+
"required": ["content"],
179185
"additionalProperties": true,
180186
"examples": [
181187
{

modules/blox/blox/faq/schema.json

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,25 @@
3939
"type": "string",
4040
"description": "The question"
4141
},
42+
"title": {
43+
"type": "string",
44+
"description": "Alias for question"
45+
},
4246
"answer": {
4347
"type": "string",
4448
"description": "The answer (Markdown supported)"
49+
},
50+
"text": {
51+
"type": "string",
52+
"description": "Alias for answer"
4553
}
4654
},
47-
"required": ["question", "answer"],
55+
"anyOf": [
56+
{ "required": ["question", "answer"] },
57+
{ "required": ["title", "text"] },
58+
{ "required": ["question", "text"] },
59+
{ "required": ["title", "answer"] }
60+
],
4861
"additionalProperties": false
4962
},
5063
"minItems": 1
@@ -85,14 +98,30 @@
8598
"items": {
8699
"type": "string"
87100
},
88-
"description": "Padding [top, right, bottom, left]"
101+
"minItems": 4,
102+
"maxItems": 4,
103+
"description": "Padding [top, right, bottom, left]",
104+
"default": ["20px", "0", "20px", "0"]
105+
},
106+
"padding_sm": {
107+
"type": "array",
108+
"items": {
109+
"type": "string"
110+
},
111+
"minItems": 2,
112+
"maxItems": 2,
113+
"description": "Responsive padding for smaller screens [top, bottom]",
114+
"default": ["3rem", "0"]
89115
},
90116
"margin": {
91117
"type": "array",
92118
"items": {
93119
"type": "string"
94120
},
95-
"description": "Margin [top, right, bottom, left]"
121+
"minItems": 4,
122+
"maxItems": 4,
123+
"description": "Margin [top, right, bottom, left]",
124+
"default": ["0", "0", "0", "0"]
96125
}
97126
},
98127
"additionalProperties": false

modules/blox/blox/features/schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
},
4343
"icon": {
4444
"type": "string",
45-
"description": "Feature icon (icon pack format: pack/icon-name)"
45+
"description": "Feature icon. Supports hero/ (Heroicons), brands/ (brand logos), devicon/ (dev tools), or custom packs. Format: 'pack/icon-name' or just 'icon-name' for hero.",
46+
"examples": ["hero/swatch", "hero/puzzle-piece", "brands/github", "devicon/python"]
4647
}
4748
},
4849
"required": ["name", "description"],

modules/blox/blox/hero/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"properties": {
100100
"no_padding": {
101101
"type": "boolean",
102-
"description": "Disable default vertical padding applied by the hero layout",
102+
"description": "Disable default vertical padding (py-32 sm:py-48 lg:py-56) applied by the hero layout",
103103
"default": false
104104
}
105105
},

modules/blox/blox/knowledge-categories/schema.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@
6262
},
6363
"count": {
6464
"type": "integer",
65-
"description": "Optional override for item count (otherwise uses taxonomy count)"
65+
"description": "Optional override for item count (otherwise uses taxonomy count)",
66+
"minimum": 0
67+
},
68+
"link": {
69+
"type": "string",
70+
"description": "Override the category URL (defaults to taxonomy page)"
6671
}
6772
},
6873
"anyOf": [

modules/blox/blox/logos/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"display_mode": {
9090
"type": "string",
9191
"enum": ["grid", "carousel", "marquee"],
92-
"description": "Layout style for the logos",
92+
"description": "Layout style: 'grid' shows all logos statically, 'carousel' scrolls horizontally with pause-on-hover, 'marquee' provides continuous horizontal scroll",
9393
"default": "grid"
9494
},
9595
"show_pattern": {

0 commit comments

Comments
 (0)