@airoom/nextmin-node 1.4.3 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/SchemaLoader.js +35 -0
- package/package.json +1 -1
|
@@ -175,6 +175,41 @@ class SchemaLoader {
|
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
processSchemas(schemas) {
|
|
178
|
+
for (const schema of Object.values(schemas)) {
|
|
179
|
+
// Inject 'meta' field for page schemas
|
|
180
|
+
if (schema.schemaType === 'page') {
|
|
181
|
+
schema.attributes.meta = {
|
|
182
|
+
type: 'json',
|
|
183
|
+
format: 'json-group',
|
|
184
|
+
label: 'SEO & Meta',
|
|
185
|
+
attributes: {
|
|
186
|
+
title: {
|
|
187
|
+
type: 'string',
|
|
188
|
+
label: 'Meta Title',
|
|
189
|
+
required: false,
|
|
190
|
+
},
|
|
191
|
+
description: {
|
|
192
|
+
type: 'string',
|
|
193
|
+
label: 'Meta Description',
|
|
194
|
+
format: 'textarea',
|
|
195
|
+
required: false,
|
|
196
|
+
},
|
|
197
|
+
keywords: {
|
|
198
|
+
type: 'string',
|
|
199
|
+
label: 'Keywords',
|
|
200
|
+
required: false,
|
|
201
|
+
},
|
|
202
|
+
jsonLd: {
|
|
203
|
+
type: 'string',
|
|
204
|
+
label: 'JSON-LD',
|
|
205
|
+
format: 'textarea',
|
|
206
|
+
required: false,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
required: false,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
178
213
|
this.schemas = Object.fromEntries(Object.entries(schemas).filter(([_, schema]) => !schema.private));
|
|
179
214
|
}
|
|
180
215
|
loadSchemasFromDirectory(directory, schemas, isUserSchema, isPackageSchema) {
|