sanity-plugin-seofields 1.3.1 → 1.4.0
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/README.md +69 -40
- package/dist/index.cjs +1924 -1618
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -17
- package/dist/index.d.ts +68 -17
- package/dist/index.js +1879 -1563
- package/dist/index.js.map +1 -1
- package/dist/next.cjs +1506 -0
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +4 -1
- package/dist/next.d.ts +4 -1
- package/dist/next.js +1457 -0
- package/dist/next.js.map +1 -1
- package/dist/schema/next.cjs +1548 -0
- package/dist/schema/next.cjs.map +1 -0
- package/dist/schema/next.d.cts +438 -0
- package/dist/schema/next.d.ts +438 -0
- package/dist/schema/next.js +1476 -0
- package/dist/schema/next.js.map +1 -0
- package/dist/schema.cjs +1743 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +387 -0
- package/dist/schema.d.ts +387 -0
- package/dist/schema.js +1691 -0
- package/dist/schema.js.map +1 -0
- package/dist/types-CVaAX7uy.d.cts +589 -0
- package/dist/types-Ci-ZZT7A.d.ts +589 -0
- package/dist/{types-B91ena4g.d.cts → types-R3n9Fu4w.d.cts} +16 -1
- package/dist/{types-B91ena4g.d.ts → types-R3n9Fu4w.d.ts} +16 -1
- package/package.json +18 -3
package/dist/next.js
CHANGED
|
@@ -136,9 +136,1466 @@ function SeoMetaTags({ data, baseUrl, path, defaults, imageUrlResolver }) {
|
|
|
136
136
|
((_r = meta.alternates) == null ? void 0 : _r.canonical) && /* @__PURE__ */ jsx("link", { rel: "canonical", href: meta.alternates.canonical })
|
|
137
137
|
] });
|
|
138
138
|
}
|
|
139
|
+
|
|
140
|
+
// src/schema/generator.ts
|
|
141
|
+
import { defineField, defineType } from "sanity";
|
|
142
|
+
var SANITY_INTERNAL_KEYS = /* @__PURE__ */ new Set([
|
|
143
|
+
"_key",
|
|
144
|
+
"_type",
|
|
145
|
+
"_ref",
|
|
146
|
+
"_id",
|
|
147
|
+
"_rev",
|
|
148
|
+
"_createdAt",
|
|
149
|
+
"_updatedAt"
|
|
150
|
+
]);
|
|
151
|
+
function buildNestedJsonLd(data, fieldDefs, jsonLdType) {
|
|
152
|
+
var _a;
|
|
153
|
+
const result = jsonLdType ? { "@type": jsonLdType } : {};
|
|
154
|
+
for (const field of fieldDefs) {
|
|
155
|
+
const value = data[field.name];
|
|
156
|
+
if (value === void 0 || value === null || value === "") continue;
|
|
157
|
+
const key = (_a = field.jsonLdKey) != null ? _a : field.name;
|
|
158
|
+
if (field.type === "object" && field.fields && typeof value === "object" && !Array.isArray(value)) {
|
|
159
|
+
const nested = buildNestedJsonLd(
|
|
160
|
+
value,
|
|
161
|
+
field.fields,
|
|
162
|
+
field.jsonLdType
|
|
163
|
+
);
|
|
164
|
+
const minKeys = field.jsonLdType ? 1 : 0;
|
|
165
|
+
if (Object.keys(nested).length > minKeys) {
|
|
166
|
+
result[key] = nested;
|
|
167
|
+
}
|
|
168
|
+
} else if (field.type === "array" && Array.isArray(value)) {
|
|
169
|
+
if (field.fields && field.jsonLdType) {
|
|
170
|
+
const items = value.filter(
|
|
171
|
+
(item) => typeof item === "object" && item !== null
|
|
172
|
+
).map((item) => buildNestedJsonLd(item, field.fields, field.jsonLdType));
|
|
173
|
+
if (items.length) result[key] = items;
|
|
174
|
+
} else if (value.length) {
|
|
175
|
+
result[key] = value.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
176
|
+
}
|
|
177
|
+
} else if (!SANITY_INTERNAL_KEYS.has(field.name)) {
|
|
178
|
+
result[key] = value;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
function buildGenericJsonLd(schemaType, data, fieldDefs, requiredFields = []) {
|
|
184
|
+
if (!data) return null;
|
|
185
|
+
for (const req of requiredFields) {
|
|
186
|
+
if (!data[req]) return null;
|
|
187
|
+
}
|
|
188
|
+
const body = buildNestedJsonLd(data, fieldDefs);
|
|
189
|
+
return __spreadValues({
|
|
190
|
+
"@context": "https://schema.org",
|
|
191
|
+
"@type": schemaType
|
|
192
|
+
}, body);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// src/schema/aggregateRating/schema.ts
|
|
196
|
+
var aggregateRatingFields = [
|
|
197
|
+
{
|
|
198
|
+
name: "ratingValue",
|
|
199
|
+
title: "Rating Value",
|
|
200
|
+
type: "string",
|
|
201
|
+
description: 'The average rating value, e.g. "4.5".',
|
|
202
|
+
required: {
|
|
203
|
+
key: "ratingValueRequired",
|
|
204
|
+
message: "Rating value is required for Schema.org."
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: "reviewCount",
|
|
209
|
+
title: "Review Count",
|
|
210
|
+
type: "string",
|
|
211
|
+
description: 'The total number of reviews, e.g. "120".'
|
|
212
|
+
}
|
|
213
|
+
];
|
|
214
|
+
|
|
215
|
+
// src/schema/article/schema.ts
|
|
216
|
+
var articleFields = [
|
|
217
|
+
{
|
|
218
|
+
name: "headline",
|
|
219
|
+
title: "Headline",
|
|
220
|
+
type: "string",
|
|
221
|
+
required: { key: "headlineRequired", message: "Headline is required for Schema.org Article." }
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "description",
|
|
225
|
+
title: "Description",
|
|
226
|
+
type: "text",
|
|
227
|
+
rows: 3
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "image",
|
|
231
|
+
title: "Image",
|
|
232
|
+
type: "url",
|
|
233
|
+
description: "URL of the article image."
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
name: "author",
|
|
237
|
+
title: "Author",
|
|
238
|
+
type: "object",
|
|
239
|
+
jsonLdType: "Person",
|
|
240
|
+
fields: [
|
|
241
|
+
{
|
|
242
|
+
name: "name",
|
|
243
|
+
title: "Author Name",
|
|
244
|
+
type: "string"
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
name: "publisher",
|
|
250
|
+
title: "Publisher",
|
|
251
|
+
type: "object",
|
|
252
|
+
jsonLdType: "Organization",
|
|
253
|
+
fields: [
|
|
254
|
+
{
|
|
255
|
+
name: "name",
|
|
256
|
+
title: "Publisher Name",
|
|
257
|
+
type: "string"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: "logo",
|
|
261
|
+
title: "Publisher Logo",
|
|
262
|
+
type: "object",
|
|
263
|
+
jsonLdType: "ImageObject",
|
|
264
|
+
fields: [
|
|
265
|
+
{
|
|
266
|
+
name: "url",
|
|
267
|
+
title: "Logo URL",
|
|
268
|
+
type: "url"
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "datePublished",
|
|
276
|
+
title: "Date Published",
|
|
277
|
+
type: "date"
|
|
278
|
+
}
|
|
279
|
+
];
|
|
280
|
+
|
|
281
|
+
// src/schema/blogPosting/schema.ts
|
|
282
|
+
var blogPostingFields = [
|
|
283
|
+
{
|
|
284
|
+
name: "headline",
|
|
285
|
+
title: "Headline",
|
|
286
|
+
type: "string",
|
|
287
|
+
required: {
|
|
288
|
+
key: "headlineRequired",
|
|
289
|
+
message: "Headline is required for Schema.org BlogPosting."
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
name: "description",
|
|
294
|
+
title: "Description",
|
|
295
|
+
type: "text",
|
|
296
|
+
rows: 3
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: "author",
|
|
300
|
+
title: "Author",
|
|
301
|
+
type: "object",
|
|
302
|
+
jsonLdType: "Person",
|
|
303
|
+
fields: [
|
|
304
|
+
{
|
|
305
|
+
name: "name",
|
|
306
|
+
title: "Author Name",
|
|
307
|
+
type: "string"
|
|
308
|
+
}
|
|
309
|
+
]
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: "datePublished",
|
|
313
|
+
title: "Date Published",
|
|
314
|
+
type: "date"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: "mainEntityOfPage",
|
|
318
|
+
title: "Main Entity of Page",
|
|
319
|
+
type: "object",
|
|
320
|
+
jsonLdType: "WebPage",
|
|
321
|
+
fields: [
|
|
322
|
+
{
|
|
323
|
+
name: "id",
|
|
324
|
+
title: "Page URL",
|
|
325
|
+
type: "url",
|
|
326
|
+
jsonLdKey: "@id"
|
|
327
|
+
}
|
|
328
|
+
]
|
|
329
|
+
}
|
|
330
|
+
];
|
|
331
|
+
|
|
332
|
+
// src/schema/brand/schema.ts
|
|
333
|
+
var brandFields = [
|
|
334
|
+
{
|
|
335
|
+
name: "name",
|
|
336
|
+
title: "Brand Name",
|
|
337
|
+
type: "string",
|
|
338
|
+
description: "The name of the brand.",
|
|
339
|
+
required: { key: "nameRequired", message: "Brand name is required for Schema.org." }
|
|
340
|
+
}
|
|
341
|
+
];
|
|
342
|
+
|
|
343
|
+
// src/schema/breadcrumbList/schema.ts
|
|
344
|
+
var breadcrumbListFields = [
|
|
345
|
+
{
|
|
346
|
+
name: "itemListElement",
|
|
347
|
+
title: "Breadcrumb Items",
|
|
348
|
+
type: "array",
|
|
349
|
+
jsonLdType: "ListItem",
|
|
350
|
+
fields: [
|
|
351
|
+
{
|
|
352
|
+
name: "position",
|
|
353
|
+
title: "Position",
|
|
354
|
+
type: "number",
|
|
355
|
+
required: { key: "positionRequired", message: "Position is required." }
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
name: "name",
|
|
359
|
+
title: "Label",
|
|
360
|
+
type: "string",
|
|
361
|
+
required: { key: "nameRequired", message: "Label is required." }
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
name: "item",
|
|
365
|
+
title: "URL",
|
|
366
|
+
type: "url"
|
|
367
|
+
}
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
];
|
|
371
|
+
|
|
372
|
+
// src/schema/contactPoint/schema.ts
|
|
373
|
+
var contactPointFields = [
|
|
374
|
+
{
|
|
375
|
+
name: "contactType",
|
|
376
|
+
title: "Contact Type",
|
|
377
|
+
type: "string",
|
|
378
|
+
description: 'The type of contact, e.g. "customer support", "sales".',
|
|
379
|
+
required: { key: "contactTypeRequired", message: "Contact type is required for Schema.org." },
|
|
380
|
+
initialValue: "customer support",
|
|
381
|
+
options: [
|
|
382
|
+
{ title: "Customer Support", value: "customer support" },
|
|
383
|
+
{ title: "Sales", value: "sales" },
|
|
384
|
+
{ title: "Technical Support", value: "technical support" },
|
|
385
|
+
{ title: "Billing", value: "billing" },
|
|
386
|
+
{ title: "General Inquiry", value: "general inquiry" }
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: "email",
|
|
391
|
+
title: "Email",
|
|
392
|
+
type: "string",
|
|
393
|
+
description: "Contact email address."
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
name: "telephone",
|
|
397
|
+
title: "Telephone",
|
|
398
|
+
type: "string",
|
|
399
|
+
description: "Contact telephone number."
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: "availableLanguage",
|
|
403
|
+
title: "Available Languages",
|
|
404
|
+
type: "array",
|
|
405
|
+
of: [{ type: "string" }],
|
|
406
|
+
description: 'Languages supported by this contact point, e.g. "English", "Spanish".',
|
|
407
|
+
initialValue: ["English"]
|
|
408
|
+
}
|
|
409
|
+
];
|
|
410
|
+
|
|
411
|
+
// src/schema/course/schema.ts
|
|
412
|
+
var courseFields = [
|
|
413
|
+
{
|
|
414
|
+
name: "name",
|
|
415
|
+
title: "Course Name",
|
|
416
|
+
type: "string",
|
|
417
|
+
description: "The name of the course.",
|
|
418
|
+
required: { key: "nameRequired", message: "Course name is required for Schema.org." }
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
name: "description",
|
|
422
|
+
title: "Description",
|
|
423
|
+
type: "text",
|
|
424
|
+
rows: 3,
|
|
425
|
+
description: "A short description of the course."
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
name: "provider",
|
|
429
|
+
title: "Provider",
|
|
430
|
+
type: "object",
|
|
431
|
+
description: "The organization that provides this course.",
|
|
432
|
+
jsonLdType: "Organization",
|
|
433
|
+
fields: [
|
|
434
|
+
{
|
|
435
|
+
name: "name",
|
|
436
|
+
title: "Provider Name",
|
|
437
|
+
type: "string",
|
|
438
|
+
description: "Name of the providing organization."
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: "sameAs",
|
|
442
|
+
title: "Provider URL",
|
|
443
|
+
type: "url",
|
|
444
|
+
description: "URL of the providing organization."
|
|
445
|
+
}
|
|
446
|
+
]
|
|
447
|
+
}
|
|
448
|
+
];
|
|
449
|
+
|
|
450
|
+
// src/schema/event/schema.ts
|
|
451
|
+
var eventFields = [
|
|
452
|
+
{
|
|
453
|
+
name: "name",
|
|
454
|
+
title: "Event Name",
|
|
455
|
+
type: "string",
|
|
456
|
+
description: "The name of the event.",
|
|
457
|
+
required: { key: "nameRequired", message: "Event name is required for Schema.org." }
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
name: "startDate",
|
|
461
|
+
title: "Start Date",
|
|
462
|
+
type: "date",
|
|
463
|
+
description: "The start date of the event."
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
name: "location",
|
|
467
|
+
title: "Location",
|
|
468
|
+
type: "object",
|
|
469
|
+
description: "The location where the event takes place.",
|
|
470
|
+
jsonLdType: "Place",
|
|
471
|
+
fields: [
|
|
472
|
+
{
|
|
473
|
+
name: "name",
|
|
474
|
+
title: "Venue Name",
|
|
475
|
+
type: "string",
|
|
476
|
+
description: "Name of the venue or location."
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
name: "address",
|
|
480
|
+
title: "Address",
|
|
481
|
+
type: "string",
|
|
482
|
+
description: "Full address as a single string."
|
|
483
|
+
}
|
|
484
|
+
]
|
|
485
|
+
}
|
|
486
|
+
];
|
|
487
|
+
|
|
488
|
+
// src/schema/faqPage/schema.ts
|
|
489
|
+
var faqPageFields = [
|
|
490
|
+
{
|
|
491
|
+
name: "mainEntity",
|
|
492
|
+
title: "FAQ Items",
|
|
493
|
+
type: "array",
|
|
494
|
+
jsonLdType: "Question",
|
|
495
|
+
fields: [
|
|
496
|
+
{
|
|
497
|
+
name: "name",
|
|
498
|
+
title: "Question",
|
|
499
|
+
type: "string",
|
|
500
|
+
required: { key: "questionRequired", message: "Question text is required." }
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
name: "acceptedAnswer",
|
|
504
|
+
title: "Accepted Answer",
|
|
505
|
+
type: "object",
|
|
506
|
+
jsonLdType: "Answer",
|
|
507
|
+
fields: [
|
|
508
|
+
{
|
|
509
|
+
name: "text",
|
|
510
|
+
title: "Answer Text",
|
|
511
|
+
type: "text",
|
|
512
|
+
rows: 3
|
|
513
|
+
}
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
]
|
|
517
|
+
}
|
|
518
|
+
];
|
|
519
|
+
|
|
520
|
+
// src/schema/howTo/schema.ts
|
|
521
|
+
var howToFields = [
|
|
522
|
+
{
|
|
523
|
+
name: "name",
|
|
524
|
+
title: "Name",
|
|
525
|
+
type: "string",
|
|
526
|
+
required: { key: "nameRequired", message: "Name is required for Schema.org HowTo." }
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
name: "description",
|
|
530
|
+
title: "Description",
|
|
531
|
+
type: "text",
|
|
532
|
+
rows: 3
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
name: "step",
|
|
536
|
+
title: "Steps",
|
|
537
|
+
type: "array",
|
|
538
|
+
jsonLdType: "HowToStep",
|
|
539
|
+
fields: [
|
|
540
|
+
{
|
|
541
|
+
name: "name",
|
|
542
|
+
title: "Step Name",
|
|
543
|
+
type: "string",
|
|
544
|
+
required: { key: "stepNameRequired", message: "Step name is required." }
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
name: "text",
|
|
548
|
+
title: "Step Description",
|
|
549
|
+
type: "text",
|
|
550
|
+
rows: 2
|
|
551
|
+
}
|
|
552
|
+
]
|
|
553
|
+
}
|
|
554
|
+
];
|
|
555
|
+
|
|
556
|
+
// src/schema/imageObject/schema.ts
|
|
557
|
+
var imageObjectFields = [
|
|
558
|
+
{
|
|
559
|
+
name: "url",
|
|
560
|
+
title: "Image URL",
|
|
561
|
+
type: "url",
|
|
562
|
+
description: "The URL of the image.",
|
|
563
|
+
required: { key: "urlRequired", message: "Image URL is required for Schema.org." }
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
name: "width",
|
|
567
|
+
title: "Width",
|
|
568
|
+
type: "number",
|
|
569
|
+
description: "Image width in pixels."
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: "height",
|
|
573
|
+
title: "Height",
|
|
574
|
+
type: "number",
|
|
575
|
+
description: "Image height in pixels."
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: "caption",
|
|
579
|
+
title: "Caption",
|
|
580
|
+
type: "string",
|
|
581
|
+
description: "Caption or alt text for the image."
|
|
582
|
+
}
|
|
583
|
+
];
|
|
584
|
+
|
|
585
|
+
// src/schema/localBusiness/schema.ts
|
|
586
|
+
var localBusinessFields = [
|
|
587
|
+
{
|
|
588
|
+
name: "name",
|
|
589
|
+
title: "Business Name",
|
|
590
|
+
type: "string",
|
|
591
|
+
description: "The official name of the business.",
|
|
592
|
+
required: { key: "nameRequired", message: "Business name is required for Schema.org." }
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: "image",
|
|
596
|
+
title: "Image URL",
|
|
597
|
+
type: "url",
|
|
598
|
+
description: "URL to the business image."
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
name: "telephone",
|
|
602
|
+
title: "Telephone",
|
|
603
|
+
type: "string",
|
|
604
|
+
description: "The telephone number of the business."
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
name: "address",
|
|
608
|
+
title: "Address",
|
|
609
|
+
type: "object",
|
|
610
|
+
description: "The physical address of the business.",
|
|
611
|
+
jsonLdType: "PostalAddress",
|
|
612
|
+
fields: [
|
|
613
|
+
{
|
|
614
|
+
name: "streetAddress",
|
|
615
|
+
title: "Street Address",
|
|
616
|
+
type: "string"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
name: "addressLocality",
|
|
620
|
+
title: "Locality",
|
|
621
|
+
type: "string",
|
|
622
|
+
description: "City or town."
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
name: "addressCountry",
|
|
626
|
+
title: "Country",
|
|
627
|
+
type: "string",
|
|
628
|
+
description: 'Country code, e.g. "US".'
|
|
629
|
+
}
|
|
630
|
+
]
|
|
631
|
+
}
|
|
632
|
+
];
|
|
633
|
+
|
|
634
|
+
// src/schema/offer/schema.ts
|
|
635
|
+
var offerFields = [
|
|
636
|
+
{
|
|
637
|
+
name: "price",
|
|
638
|
+
title: "Price",
|
|
639
|
+
type: "string",
|
|
640
|
+
description: 'The price of the offer, e.g. "199.99".',
|
|
641
|
+
required: { key: "priceRequired", message: "Price is required for Schema.org." }
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
name: "priceCurrency",
|
|
645
|
+
title: "Currency",
|
|
646
|
+
type: "string",
|
|
647
|
+
description: 'The currency of the price, e.g. "USD".',
|
|
648
|
+
initialValue: "USD",
|
|
649
|
+
options: [
|
|
650
|
+
{ title: "USD", value: "USD" },
|
|
651
|
+
{ title: "EUR", value: "EUR" },
|
|
652
|
+
{ title: "GBP", value: "GBP" },
|
|
653
|
+
{ title: "INR", value: "INR" },
|
|
654
|
+
{ title: "JPY", value: "JPY" },
|
|
655
|
+
{ title: "CAD", value: "CAD" },
|
|
656
|
+
{ title: "AUD", value: "AUD" }
|
|
657
|
+
]
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: "availability",
|
|
661
|
+
title: "Availability",
|
|
662
|
+
type: "url",
|
|
663
|
+
description: 'Schema.org availability URL, e.g. "https://schema.org/InStock".'
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
name: "url",
|
|
667
|
+
title: "Offer URL",
|
|
668
|
+
type: "url",
|
|
669
|
+
description: "URL of the offer page."
|
|
670
|
+
}
|
|
671
|
+
];
|
|
672
|
+
|
|
673
|
+
// src/schema/utils.ts
|
|
674
|
+
function escapeJsonForScript(json) {
|
|
675
|
+
return json.replace(/</g, "\\u003C").replace(/>/g, "\\u003E").replace(/&/g, "\\u0026").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// src/schema/organization/component.tsx
|
|
679
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
680
|
+
function buildOrganizationJsonLd(data, imageUrlResolver) {
|
|
681
|
+
var _a, _b, _c;
|
|
682
|
+
if (!(data == null ? void 0 : data.name) || !(data == null ? void 0 : data.url)) return null;
|
|
683
|
+
const jsonLd = {
|
|
684
|
+
"@context": "https://schema.org",
|
|
685
|
+
"@type": "Organization",
|
|
686
|
+
name: data.name,
|
|
687
|
+
url: data.url
|
|
688
|
+
};
|
|
689
|
+
const logoUrl = data.logoUrl || (data.logo && imageUrlResolver ? imageUrlResolver(data.logo) : void 0);
|
|
690
|
+
if (logoUrl) jsonLd.logo = logoUrl;
|
|
691
|
+
if (data.description) jsonLd.description = data.description;
|
|
692
|
+
if ((_a = data.sameAs) == null ? void 0 : _a.length) jsonLd.sameAs = data.sameAs;
|
|
693
|
+
if ((_b = data.contactPoint) == null ? void 0 : _b.contactType) {
|
|
694
|
+
const cp = {
|
|
695
|
+
"@type": "ContactPoint",
|
|
696
|
+
contactType: data.contactPoint.contactType
|
|
697
|
+
};
|
|
698
|
+
if (data.contactPoint.email) cp.email = data.contactPoint.email;
|
|
699
|
+
if ((_c = data.contactPoint.availableLanguage) == null ? void 0 : _c.length) {
|
|
700
|
+
cp.availableLanguage = data.contactPoint.availableLanguage;
|
|
701
|
+
}
|
|
702
|
+
jsonLd.contactPoint = cp;
|
|
703
|
+
}
|
|
704
|
+
return jsonLd;
|
|
705
|
+
}
|
|
706
|
+
function OrganizationSchema({
|
|
707
|
+
data,
|
|
708
|
+
imageUrlResolver
|
|
709
|
+
}) {
|
|
710
|
+
const jsonLd = buildOrganizationJsonLd(data, imageUrlResolver);
|
|
711
|
+
if (!jsonLd) return null;
|
|
712
|
+
return /* @__PURE__ */ jsx2(
|
|
713
|
+
"script",
|
|
714
|
+
{
|
|
715
|
+
type: "application/ld+json",
|
|
716
|
+
dangerouslySetInnerHTML: { __html: escapeJsonForScript(JSON.stringify(jsonLd)) }
|
|
717
|
+
}
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// src/schema/person/schema.ts
|
|
722
|
+
var personFields = [
|
|
723
|
+
{
|
|
724
|
+
name: "name",
|
|
725
|
+
title: "Full Name",
|
|
726
|
+
type: "string",
|
|
727
|
+
description: "The full name of the person.",
|
|
728
|
+
required: { key: "nameRequired", message: "Person name is required for Schema.org." }
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
name: "jobTitle",
|
|
732
|
+
title: "Job Title",
|
|
733
|
+
type: "string",
|
|
734
|
+
description: "The job title or role of the person."
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
name: "url",
|
|
738
|
+
title: "Profile URL",
|
|
739
|
+
type: "url",
|
|
740
|
+
description: "URL of the person's profile or personal website."
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
name: "imageUrl",
|
|
744
|
+
title: "Image URL",
|
|
745
|
+
type: "url",
|
|
746
|
+
description: "URL to a photo/image of this person.",
|
|
747
|
+
jsonLdKey: "image"
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
name: "sameAs",
|
|
751
|
+
title: "Social / External Profiles",
|
|
752
|
+
type: "array",
|
|
753
|
+
of: [{ type: "url" }],
|
|
754
|
+
description: "URLs of social media profiles and other authoritative pages (LinkedIn, GitHub, etc.)."
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
name: "worksFor",
|
|
758
|
+
title: "Works For",
|
|
759
|
+
type: "object",
|
|
760
|
+
description: "The organization this person works for.",
|
|
761
|
+
jsonLdType: "Organization",
|
|
762
|
+
fields: [
|
|
763
|
+
{
|
|
764
|
+
name: "name",
|
|
765
|
+
title: "Organization Name",
|
|
766
|
+
type: "string",
|
|
767
|
+
description: "Name of the organization."
|
|
768
|
+
}
|
|
769
|
+
]
|
|
770
|
+
}
|
|
771
|
+
];
|
|
772
|
+
|
|
773
|
+
// src/schema/place/schema.ts
|
|
774
|
+
var placeFields = [
|
|
775
|
+
{
|
|
776
|
+
name: "name",
|
|
777
|
+
title: "Place Name",
|
|
778
|
+
type: "string",
|
|
779
|
+
description: "The name of the place.",
|
|
780
|
+
required: { key: "nameRequired", message: "Place name is required for Schema.org." }
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
name: "address",
|
|
784
|
+
title: "Address",
|
|
785
|
+
type: "object",
|
|
786
|
+
description: "The physical address of the place.",
|
|
787
|
+
jsonLdType: "PostalAddress",
|
|
788
|
+
fields: [
|
|
789
|
+
{
|
|
790
|
+
name: "addressLocality",
|
|
791
|
+
title: "Locality",
|
|
792
|
+
type: "string",
|
|
793
|
+
description: "City or town."
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
name: "addressCountry",
|
|
797
|
+
title: "Country",
|
|
798
|
+
type: "string",
|
|
799
|
+
description: 'Country code, e.g. "US".'
|
|
800
|
+
}
|
|
801
|
+
]
|
|
802
|
+
}
|
|
803
|
+
];
|
|
804
|
+
|
|
805
|
+
// src/schema/postalAddress/schema.ts
|
|
806
|
+
var postalAddressFields = [
|
|
807
|
+
{
|
|
808
|
+
name: "streetAddress",
|
|
809
|
+
title: "Street Address",
|
|
810
|
+
type: "string",
|
|
811
|
+
description: 'The street address, e.g. "123 Main St".'
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
name: "addressLocality",
|
|
815
|
+
title: "City / Locality",
|
|
816
|
+
type: "string",
|
|
817
|
+
description: 'The city or locality, e.g. "New York".'
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
name: "postalCode",
|
|
821
|
+
title: "Postal Code",
|
|
822
|
+
type: "string",
|
|
823
|
+
description: 'The postal or ZIP code, e.g. "10001".'
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
name: "addressCountry",
|
|
827
|
+
title: "Country",
|
|
828
|
+
type: "string",
|
|
829
|
+
description: 'The country code, e.g. "US".'
|
|
830
|
+
}
|
|
831
|
+
];
|
|
832
|
+
|
|
833
|
+
// src/schema/product/schema.ts
|
|
834
|
+
var productFields = [
|
|
835
|
+
{
|
|
836
|
+
name: "name",
|
|
837
|
+
title: "Product Name",
|
|
838
|
+
type: "string",
|
|
839
|
+
description: "The name of the product.",
|
|
840
|
+
required: { key: "nameRequired", message: "Product name is required for Schema.org." }
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
name: "imageUrl",
|
|
844
|
+
title: "Image URL",
|
|
845
|
+
type: "url",
|
|
846
|
+
description: "URL to the product image.",
|
|
847
|
+
jsonLdKey: "image"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
name: "description",
|
|
851
|
+
title: "Description",
|
|
852
|
+
type: "text",
|
|
853
|
+
rows: 3,
|
|
854
|
+
description: "A short description of the product."
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
name: "brand",
|
|
858
|
+
title: "Brand",
|
|
859
|
+
type: "object",
|
|
860
|
+
description: "The brand of the product.",
|
|
861
|
+
jsonLdType: "Brand",
|
|
862
|
+
fields: [
|
|
863
|
+
{
|
|
864
|
+
name: "name",
|
|
865
|
+
title: "Brand Name",
|
|
866
|
+
type: "string",
|
|
867
|
+
description: "Name of the brand."
|
|
868
|
+
}
|
|
869
|
+
]
|
|
870
|
+
}
|
|
871
|
+
];
|
|
872
|
+
|
|
873
|
+
// src/schema/review/schema.ts
|
|
874
|
+
var reviewFields = [
|
|
875
|
+
{
|
|
876
|
+
name: "reviewRating",
|
|
877
|
+
title: "Review Rating",
|
|
878
|
+
type: "object",
|
|
879
|
+
jsonLdType: "Rating",
|
|
880
|
+
fields: [
|
|
881
|
+
{
|
|
882
|
+
name: "ratingValue",
|
|
883
|
+
title: "Rating Value",
|
|
884
|
+
type: "string",
|
|
885
|
+
required: {
|
|
886
|
+
key: "ratingValueRequired",
|
|
887
|
+
message: "Rating value is required for Schema.org Review."
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
]
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
name: "author",
|
|
894
|
+
title: "Author",
|
|
895
|
+
type: "object",
|
|
896
|
+
jsonLdType: "Person",
|
|
897
|
+
fields: [
|
|
898
|
+
{
|
|
899
|
+
name: "name",
|
|
900
|
+
title: "Author Name",
|
|
901
|
+
type: "string",
|
|
902
|
+
required: {
|
|
903
|
+
key: "authorNameRequired",
|
|
904
|
+
message: "Author name is required for Schema.org Review."
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
]
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
name: "reviewBody",
|
|
911
|
+
title: "Review Body",
|
|
912
|
+
type: "text",
|
|
913
|
+
rows: 3
|
|
914
|
+
}
|
|
915
|
+
];
|
|
916
|
+
|
|
917
|
+
// src/schema/SchemaOrgScript.tsx
|
|
918
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
919
|
+
function SchemaOrgScript({
|
|
920
|
+
jsonLd
|
|
921
|
+
}) {
|
|
922
|
+
if (!jsonLd) return null;
|
|
923
|
+
return /* @__PURE__ */ jsx3(
|
|
924
|
+
"script",
|
|
925
|
+
{
|
|
926
|
+
type: "application/ld+json",
|
|
927
|
+
dangerouslySetInnerHTML: { __html: escapeJsonForScript(JSON.stringify(jsonLd)) }
|
|
928
|
+
}
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
// src/schema/softwareApplication/schema.ts
|
|
933
|
+
var softwareApplicationFields = [
|
|
934
|
+
{
|
|
935
|
+
name: "name",
|
|
936
|
+
title: "Application Name",
|
|
937
|
+
type: "string",
|
|
938
|
+
description: "The name of the software application.",
|
|
939
|
+
required: {
|
|
940
|
+
key: "nameRequired",
|
|
941
|
+
message: "Application name is required for Schema.org."
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
{
|
|
945
|
+
name: "applicationCategory",
|
|
946
|
+
title: "Application Category",
|
|
947
|
+
type: "string",
|
|
948
|
+
description: "The category of the application.",
|
|
949
|
+
options: [
|
|
950
|
+
{ title: "Developer Application", value: "DeveloperApplication" },
|
|
951
|
+
{ title: "Business Application", value: "BusinessApplication" },
|
|
952
|
+
{ title: "Game Application", value: "GameApplication" },
|
|
953
|
+
{ title: "Educational Application", value: "EducationalApplication" },
|
|
954
|
+
{ title: "Utilities Application", value: "UtilitiesApplication" },
|
|
955
|
+
{ title: "Social Networking Application", value: "SocialNetworkingApplication" }
|
|
956
|
+
]
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
name: "operatingSystem",
|
|
960
|
+
title: "Operating System",
|
|
961
|
+
type: "string",
|
|
962
|
+
description: 'The supported operating systems, e.g. "Windows, macOS".'
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
name: "url",
|
|
966
|
+
title: "Application URL",
|
|
967
|
+
type: "url",
|
|
968
|
+
description: "URL of the software application."
|
|
969
|
+
}
|
|
970
|
+
];
|
|
971
|
+
|
|
972
|
+
// src/schema/videoObject/schema.ts
|
|
973
|
+
var videoObjectFields = [
|
|
974
|
+
{
|
|
975
|
+
name: "name",
|
|
976
|
+
title: "Video Name",
|
|
977
|
+
type: "string",
|
|
978
|
+
description: "The name of the video.",
|
|
979
|
+
required: { key: "nameRequired", message: "Video name is required for Schema.org." }
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
name: "description",
|
|
983
|
+
title: "Description",
|
|
984
|
+
type: "text",
|
|
985
|
+
rows: 3,
|
|
986
|
+
description: "A description of the video."
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
name: "thumbnailUrl",
|
|
990
|
+
title: "Thumbnail URL",
|
|
991
|
+
type: "url",
|
|
992
|
+
description: "URL of the video thumbnail image."
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
name: "uploadDate",
|
|
996
|
+
title: "Upload Date",
|
|
997
|
+
type: "date",
|
|
998
|
+
description: "The date the video was uploaded."
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
name: "contentUrl",
|
|
1002
|
+
title: "Content URL",
|
|
1003
|
+
type: "url",
|
|
1004
|
+
description: "URL to the actual video file."
|
|
1005
|
+
}
|
|
1006
|
+
];
|
|
1007
|
+
|
|
1008
|
+
// src/schema/webApplication/schema.ts
|
|
1009
|
+
var webApplicationFields = [
|
|
1010
|
+
{
|
|
1011
|
+
name: "name",
|
|
1012
|
+
title: "Application Name",
|
|
1013
|
+
type: "string",
|
|
1014
|
+
description: "The name of the web application.",
|
|
1015
|
+
required: {
|
|
1016
|
+
key: "nameRequired",
|
|
1017
|
+
message: "Application name is required for Schema.org."
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
name: "url",
|
|
1022
|
+
title: "Application URL",
|
|
1023
|
+
type: "url",
|
|
1024
|
+
description: "URL of the web application.",
|
|
1025
|
+
required: { key: "urlRequired", message: "Application URL is required for Schema.org." }
|
|
1026
|
+
},
|
|
1027
|
+
{
|
|
1028
|
+
name: "applicationCategory",
|
|
1029
|
+
title: "Application Category",
|
|
1030
|
+
type: "string",
|
|
1031
|
+
description: "The category of the application.",
|
|
1032
|
+
options: [
|
|
1033
|
+
{ title: "Developer Application", value: "DeveloperApplication" },
|
|
1034
|
+
{ title: "Business Application", value: "BusinessApplication" },
|
|
1035
|
+
{ title: "Game Application", value: "GameApplication" },
|
|
1036
|
+
{ title: "Educational Application", value: "EducationalApplication" },
|
|
1037
|
+
{ title: "Utilities Application", value: "UtilitiesApplication" },
|
|
1038
|
+
{ title: "Social Networking Application", value: "SocialNetworkingApplication" }
|
|
1039
|
+
]
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
name: "operatingSystem",
|
|
1043
|
+
title: "Operating System",
|
|
1044
|
+
type: "string",
|
|
1045
|
+
description: "The supported operating systems.",
|
|
1046
|
+
initialValue: "All"
|
|
1047
|
+
}
|
|
1048
|
+
];
|
|
1049
|
+
|
|
1050
|
+
// src/schema/webPage/schema.ts
|
|
1051
|
+
var webPageFields = [
|
|
1052
|
+
{
|
|
1053
|
+
name: "name",
|
|
1054
|
+
title: "Page Name",
|
|
1055
|
+
type: "string",
|
|
1056
|
+
description: "The title of the page.",
|
|
1057
|
+
required: { key: "nameRequired", message: "Page name is required for Schema.org." }
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
name: "url",
|
|
1061
|
+
title: "Page URL",
|
|
1062
|
+
type: "url",
|
|
1063
|
+
description: "The full URL of the page.",
|
|
1064
|
+
required: { key: "urlRequired", message: "Page URL is required for Schema.org." }
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
name: "description",
|
|
1068
|
+
title: "Description",
|
|
1069
|
+
type: "text",
|
|
1070
|
+
rows: 3,
|
|
1071
|
+
description: "A short description of the page."
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
name: "inLanguage",
|
|
1075
|
+
title: "Language",
|
|
1076
|
+
type: "string",
|
|
1077
|
+
description: 'The language of the page content, e.g. "en".',
|
|
1078
|
+
initialValue: "en",
|
|
1079
|
+
options: [
|
|
1080
|
+
{ title: "English", value: "en" },
|
|
1081
|
+
{ title: "Spanish", value: "es" },
|
|
1082
|
+
{ title: "French", value: "fr" },
|
|
1083
|
+
{ title: "German", value: "de" },
|
|
1084
|
+
{ title: "Portuguese", value: "pt" },
|
|
1085
|
+
{ title: "Italian", value: "it" },
|
|
1086
|
+
{ title: "Dutch", value: "nl" },
|
|
1087
|
+
{ title: "Japanese", value: "ja" },
|
|
1088
|
+
{ title: "Chinese", value: "zh" },
|
|
1089
|
+
{ title: "Korean", value: "ko" },
|
|
1090
|
+
{ title: "Hindi", value: "hi" },
|
|
1091
|
+
{ title: "Arabic", value: "ar" }
|
|
1092
|
+
]
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
name: "isPartOf",
|
|
1096
|
+
title: "Part Of (Website)",
|
|
1097
|
+
type: "object",
|
|
1098
|
+
description: "The website this page belongs to.",
|
|
1099
|
+
jsonLdType: "WebSite",
|
|
1100
|
+
fields: [
|
|
1101
|
+
{
|
|
1102
|
+
name: "url",
|
|
1103
|
+
title: "Website URL",
|
|
1104
|
+
type: "url",
|
|
1105
|
+
description: "URL of the parent website."
|
|
1106
|
+
}
|
|
1107
|
+
]
|
|
1108
|
+
}
|
|
1109
|
+
];
|
|
1110
|
+
|
|
1111
|
+
// src/schema/website/component.tsx
|
|
1112
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1113
|
+
function buildWebsiteJsonLd(data) {
|
|
1114
|
+
var _a;
|
|
1115
|
+
if (!(data == null ? void 0 : data.name) || !(data == null ? void 0 : data.url)) return null;
|
|
1116
|
+
const jsonLd = {
|
|
1117
|
+
"@context": "https://schema.org",
|
|
1118
|
+
"@type": "WebSite",
|
|
1119
|
+
name: data.name,
|
|
1120
|
+
url: data.url
|
|
1121
|
+
};
|
|
1122
|
+
if (data.description) jsonLd.description = data.description;
|
|
1123
|
+
if (data.inLanguage) jsonLd.inLanguage = data.inLanguage;
|
|
1124
|
+
if ((_a = data.publisher) == null ? void 0 : _a.name) {
|
|
1125
|
+
const publisher = {
|
|
1126
|
+
"@type": "Organization",
|
|
1127
|
+
name: data.publisher.name
|
|
1128
|
+
};
|
|
1129
|
+
if (data.publisher.url) publisher.url = data.publisher.url;
|
|
1130
|
+
if (data.publisher.logoUrl) {
|
|
1131
|
+
publisher.logo = {
|
|
1132
|
+
"@type": "ImageObject",
|
|
1133
|
+
url: data.publisher.logoUrl
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1136
|
+
jsonLd.publisher = publisher;
|
|
1137
|
+
}
|
|
1138
|
+
return jsonLd;
|
|
1139
|
+
}
|
|
1140
|
+
function WebsiteSchema({ data }) {
|
|
1141
|
+
const jsonLd = buildWebsiteJsonLd(data);
|
|
1142
|
+
if (!jsonLd) return null;
|
|
1143
|
+
return /* @__PURE__ */ jsx4(
|
|
1144
|
+
"script",
|
|
1145
|
+
{
|
|
1146
|
+
type: "application/ld+json",
|
|
1147
|
+
dangerouslySetInnerHTML: { __html: escapeJsonForScript(JSON.stringify(jsonLd)) }
|
|
1148
|
+
}
|
|
1149
|
+
);
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
// src/schema/SchemaOrgScripts.tsx
|
|
1153
|
+
import { Fragment as Fragment2, jsx as jsx5 } from "react/jsx-runtime";
|
|
1154
|
+
var GENERIC_TYPES = {
|
|
1155
|
+
schemaOrgWebPage: { schemaType: "WebPage", fields: webPageFields, requiredFields: ["name"] },
|
|
1156
|
+
schemaOrgPerson: { schemaType: "Person", fields: personFields, requiredFields: ["name"] },
|
|
1157
|
+
schemaOrgBreadcrumbList: {
|
|
1158
|
+
schemaType: "BreadcrumbList",
|
|
1159
|
+
fields: breadcrumbListFields,
|
|
1160
|
+
requiredFields: []
|
|
1161
|
+
},
|
|
1162
|
+
schemaOrgImageObject: {
|
|
1163
|
+
schemaType: "ImageObject",
|
|
1164
|
+
fields: imageObjectFields,
|
|
1165
|
+
requiredFields: ["url"]
|
|
1166
|
+
},
|
|
1167
|
+
schemaOrgArticle: { schemaType: "Article", fields: articleFields, requiredFields: ["headline"] },
|
|
1168
|
+
schemaOrgBlogPosting: {
|
|
1169
|
+
schemaType: "BlogPosting",
|
|
1170
|
+
fields: blogPostingFields,
|
|
1171
|
+
requiredFields: ["headline"]
|
|
1172
|
+
},
|
|
1173
|
+
schemaOrgFAQPage: { schemaType: "FAQPage", fields: faqPageFields, requiredFields: [] },
|
|
1174
|
+
schemaOrgHowTo: { schemaType: "HowTo", fields: howToFields, requiredFields: ["name"] },
|
|
1175
|
+
schemaOrgProduct: { schemaType: "Product", fields: productFields, requiredFields: ["name"] },
|
|
1176
|
+
schemaOrgOffer: { schemaType: "Offer", fields: offerFields, requiredFields: ["price"] },
|
|
1177
|
+
schemaOrgAggregateRating: {
|
|
1178
|
+
schemaType: "AggregateRating",
|
|
1179
|
+
fields: aggregateRatingFields,
|
|
1180
|
+
requiredFields: ["ratingValue"]
|
|
1181
|
+
},
|
|
1182
|
+
schemaOrgReview: { schemaType: "Review", fields: reviewFields, requiredFields: [] },
|
|
1183
|
+
schemaOrgBrand: { schemaType: "Brand", fields: brandFields, requiredFields: ["name"] },
|
|
1184
|
+
schemaOrgLocalBusiness: {
|
|
1185
|
+
schemaType: "LocalBusiness",
|
|
1186
|
+
fields: localBusinessFields,
|
|
1187
|
+
requiredFields: ["name"]
|
|
1188
|
+
},
|
|
1189
|
+
schemaOrgPostalAddress: {
|
|
1190
|
+
schemaType: "PostalAddress",
|
|
1191
|
+
fields: postalAddressFields,
|
|
1192
|
+
requiredFields: []
|
|
1193
|
+
},
|
|
1194
|
+
schemaOrgContactPoint: {
|
|
1195
|
+
schemaType: "ContactPoint",
|
|
1196
|
+
fields: contactPointFields,
|
|
1197
|
+
requiredFields: []
|
|
1198
|
+
},
|
|
1199
|
+
schemaOrgSoftwareApplication: {
|
|
1200
|
+
schemaType: "SoftwareApplication",
|
|
1201
|
+
fields: softwareApplicationFields,
|
|
1202
|
+
requiredFields: ["name"]
|
|
1203
|
+
},
|
|
1204
|
+
schemaOrgWebApplication: {
|
|
1205
|
+
schemaType: "WebApplication",
|
|
1206
|
+
fields: webApplicationFields,
|
|
1207
|
+
requiredFields: ["name"]
|
|
1208
|
+
},
|
|
1209
|
+
schemaOrgEvent: { schemaType: "Event", fields: eventFields, requiredFields: ["name"] },
|
|
1210
|
+
schemaOrgPlace: { schemaType: "Place", fields: placeFields, requiredFields: ["name"] },
|
|
1211
|
+
schemaOrgVideoObject: {
|
|
1212
|
+
schemaType: "VideoObject",
|
|
1213
|
+
fields: videoObjectFields,
|
|
1214
|
+
requiredFields: ["name"]
|
|
1215
|
+
},
|
|
1216
|
+
schemaOrgCourse: { schemaType: "Course", fields: courseFields, requiredFields: ["name"] }
|
|
1217
|
+
};
|
|
1218
|
+
function buildJsonLdForItem(item) {
|
|
1219
|
+
const type = item._type;
|
|
1220
|
+
if (!type) return null;
|
|
1221
|
+
if (type === "schemaOrgWebsite") {
|
|
1222
|
+
return buildWebsiteJsonLd(item);
|
|
1223
|
+
}
|
|
1224
|
+
if (type === "schemaOrgOrganization") {
|
|
1225
|
+
return buildOrganizationJsonLd(item);
|
|
1226
|
+
}
|
|
1227
|
+
const entry = GENERIC_TYPES[type];
|
|
1228
|
+
if (!entry) return null;
|
|
1229
|
+
return buildGenericJsonLd(entry.schemaType, item, entry.fields, entry.requiredFields);
|
|
1230
|
+
}
|
|
1231
|
+
function SchemaOrgScripts({ data }) {
|
|
1232
|
+
if (!(data == null ? void 0 : data.length)) return null;
|
|
1233
|
+
const scripts = data.map((item) => buildJsonLdForItem(item)).filter((jsonLd) => jsonLd !== null);
|
|
1234
|
+
if (!scripts.length) return null;
|
|
1235
|
+
return /* @__PURE__ */ jsx5(Fragment2, { children: scripts.map((jsonLd) => /* @__PURE__ */ jsx5(SchemaOrgScript, { jsonLd }, JSON.stringify(jsonLd))) });
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
// src/schema/aggregateRating/component.tsx
|
|
1239
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1240
|
+
function buildAggregateRatingJsonLd(data) {
|
|
1241
|
+
return buildGenericJsonLd(
|
|
1242
|
+
"AggregateRating",
|
|
1243
|
+
data,
|
|
1244
|
+
aggregateRatingFields,
|
|
1245
|
+
["ratingValue"]
|
|
1246
|
+
);
|
|
1247
|
+
}
|
|
1248
|
+
function AggregateRatingSchema({ data }) {
|
|
1249
|
+
return /* @__PURE__ */ jsx6(SchemaOrgScript, { jsonLd: buildAggregateRatingJsonLd(data) });
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
// src/schema/article/component.tsx
|
|
1253
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
1254
|
+
function buildArticleJsonLd(data) {
|
|
1255
|
+
return buildGenericJsonLd(
|
|
1256
|
+
"Article",
|
|
1257
|
+
data,
|
|
1258
|
+
articleFields,
|
|
1259
|
+
["headline"]
|
|
1260
|
+
);
|
|
1261
|
+
}
|
|
1262
|
+
function ArticleSchema({ data }) {
|
|
1263
|
+
return /* @__PURE__ */ jsx7(SchemaOrgScript, { jsonLd: buildArticleJsonLd(data) });
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
// src/schema/blogPosting/component.tsx
|
|
1267
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1268
|
+
function buildBlogPostingJsonLd(data) {
|
|
1269
|
+
return buildGenericJsonLd(
|
|
1270
|
+
"BlogPosting",
|
|
1271
|
+
data,
|
|
1272
|
+
blogPostingFields,
|
|
1273
|
+
["headline"]
|
|
1274
|
+
);
|
|
1275
|
+
}
|
|
1276
|
+
function BlogPostingSchema({ data }) {
|
|
1277
|
+
return /* @__PURE__ */ jsx8(SchemaOrgScript, { jsonLd: buildBlogPostingJsonLd(data) });
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
// src/schema/brand/component.tsx
|
|
1281
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
1282
|
+
function buildBrandJsonLd(data) {
|
|
1283
|
+
return buildGenericJsonLd(
|
|
1284
|
+
"Brand",
|
|
1285
|
+
data,
|
|
1286
|
+
brandFields,
|
|
1287
|
+
["name"]
|
|
1288
|
+
);
|
|
1289
|
+
}
|
|
1290
|
+
function BrandSchema({ data }) {
|
|
1291
|
+
return /* @__PURE__ */ jsx9(SchemaOrgScript, { jsonLd: buildBrandJsonLd(data) });
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
// src/schema/breadcrumbList/component.tsx
|
|
1295
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1296
|
+
function buildBreadcrumbListJsonLd(data) {
|
|
1297
|
+
return buildGenericJsonLd(
|
|
1298
|
+
"BreadcrumbList",
|
|
1299
|
+
data,
|
|
1300
|
+
breadcrumbListFields,
|
|
1301
|
+
[]
|
|
1302
|
+
);
|
|
1303
|
+
}
|
|
1304
|
+
function BreadcrumbListSchema({ data }) {
|
|
1305
|
+
return /* @__PURE__ */ jsx10(SchemaOrgScript, { jsonLd: buildBreadcrumbListJsonLd(data) });
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
// src/schema/contactPoint/component.tsx
|
|
1309
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1310
|
+
function buildContactPointJsonLd(data) {
|
|
1311
|
+
return buildGenericJsonLd(
|
|
1312
|
+
"ContactPoint",
|
|
1313
|
+
data,
|
|
1314
|
+
contactPointFields,
|
|
1315
|
+
["contactType"]
|
|
1316
|
+
);
|
|
1317
|
+
}
|
|
1318
|
+
function ContactPointSchema({ data }) {
|
|
1319
|
+
return /* @__PURE__ */ jsx11(SchemaOrgScript, { jsonLd: buildContactPointJsonLd(data) });
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
// src/schema/course/component.tsx
|
|
1323
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1324
|
+
function buildCourseJsonLd(data) {
|
|
1325
|
+
return buildGenericJsonLd(
|
|
1326
|
+
"Course",
|
|
1327
|
+
data,
|
|
1328
|
+
courseFields,
|
|
1329
|
+
["name"]
|
|
1330
|
+
);
|
|
1331
|
+
}
|
|
1332
|
+
function CourseSchema({ data }) {
|
|
1333
|
+
return /* @__PURE__ */ jsx12(SchemaOrgScript, { jsonLd: buildCourseJsonLd(data) });
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// src/schema/event/component.tsx
|
|
1337
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1338
|
+
function buildEventJsonLd(data) {
|
|
1339
|
+
return buildGenericJsonLd(
|
|
1340
|
+
"Event",
|
|
1341
|
+
data,
|
|
1342
|
+
eventFields,
|
|
1343
|
+
["name"]
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1346
|
+
function EventSchema({ data }) {
|
|
1347
|
+
return /* @__PURE__ */ jsx13(SchemaOrgScript, { jsonLd: buildEventJsonLd(data) });
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
// src/schema/faqPage/component.tsx
|
|
1351
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1352
|
+
function buildFAQPageJsonLd(data) {
|
|
1353
|
+
return buildGenericJsonLd(
|
|
1354
|
+
"FAQPage",
|
|
1355
|
+
data,
|
|
1356
|
+
faqPageFields,
|
|
1357
|
+
[]
|
|
1358
|
+
);
|
|
1359
|
+
}
|
|
1360
|
+
function FAQPageSchema({ data }) {
|
|
1361
|
+
return /* @__PURE__ */ jsx14(SchemaOrgScript, { jsonLd: buildFAQPageJsonLd(data) });
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
// src/schema/howTo/component.tsx
|
|
1365
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1366
|
+
function buildHowToJsonLd(data) {
|
|
1367
|
+
return buildGenericJsonLd(
|
|
1368
|
+
"HowTo",
|
|
1369
|
+
data,
|
|
1370
|
+
howToFields,
|
|
1371
|
+
["name"]
|
|
1372
|
+
);
|
|
1373
|
+
}
|
|
1374
|
+
function HowToSchema({ data }) {
|
|
1375
|
+
return /* @__PURE__ */ jsx15(SchemaOrgScript, { jsonLd: buildHowToJsonLd(data) });
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
// src/schema/imageObject/component.tsx
|
|
1379
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1380
|
+
function buildImageObjectJsonLd(data) {
|
|
1381
|
+
return buildGenericJsonLd(
|
|
1382
|
+
"ImageObject",
|
|
1383
|
+
data,
|
|
1384
|
+
imageObjectFields,
|
|
1385
|
+
["url"]
|
|
1386
|
+
);
|
|
1387
|
+
}
|
|
1388
|
+
function ImageObjectSchema({ data }) {
|
|
1389
|
+
return /* @__PURE__ */ jsx16(SchemaOrgScript, { jsonLd: buildImageObjectJsonLd(data) });
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
// src/schema/localBusiness/component.tsx
|
|
1393
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1394
|
+
function buildLocalBusinessJsonLd(data) {
|
|
1395
|
+
return buildGenericJsonLd(
|
|
1396
|
+
"LocalBusiness",
|
|
1397
|
+
data,
|
|
1398
|
+
localBusinessFields,
|
|
1399
|
+
["name"]
|
|
1400
|
+
);
|
|
1401
|
+
}
|
|
1402
|
+
function LocalBusinessSchema({ data }) {
|
|
1403
|
+
return /* @__PURE__ */ jsx17(SchemaOrgScript, { jsonLd: buildLocalBusinessJsonLd(data) });
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
// src/schema/offer/component.tsx
|
|
1407
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1408
|
+
function buildOfferJsonLd(data) {
|
|
1409
|
+
return buildGenericJsonLd(
|
|
1410
|
+
"Offer",
|
|
1411
|
+
data,
|
|
1412
|
+
offerFields,
|
|
1413
|
+
["price"]
|
|
1414
|
+
);
|
|
1415
|
+
}
|
|
1416
|
+
function OfferSchema({ data }) {
|
|
1417
|
+
return /* @__PURE__ */ jsx18(SchemaOrgScript, { jsonLd: buildOfferJsonLd(data) });
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
// src/schema/person/component.tsx
|
|
1421
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1422
|
+
function buildPersonJsonLd(data) {
|
|
1423
|
+
return buildGenericJsonLd(
|
|
1424
|
+
"Person",
|
|
1425
|
+
data,
|
|
1426
|
+
personFields,
|
|
1427
|
+
["name"]
|
|
1428
|
+
);
|
|
1429
|
+
}
|
|
1430
|
+
function PersonSchema({ data }) {
|
|
1431
|
+
return /* @__PURE__ */ jsx19(SchemaOrgScript, { jsonLd: buildPersonJsonLd(data) });
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
// src/schema/place/component.tsx
|
|
1435
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1436
|
+
function buildPlaceJsonLd(data) {
|
|
1437
|
+
return buildGenericJsonLd(
|
|
1438
|
+
"Place",
|
|
1439
|
+
data,
|
|
1440
|
+
placeFields,
|
|
1441
|
+
["name"]
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
function PlaceSchema({ data }) {
|
|
1445
|
+
return /* @__PURE__ */ jsx20(SchemaOrgScript, { jsonLd: buildPlaceJsonLd(data) });
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
// src/schema/postalAddress/component.tsx
|
|
1449
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1450
|
+
function buildPostalAddressJsonLd(data) {
|
|
1451
|
+
return buildGenericJsonLd(
|
|
1452
|
+
"PostalAddress",
|
|
1453
|
+
data,
|
|
1454
|
+
postalAddressFields,
|
|
1455
|
+
[]
|
|
1456
|
+
);
|
|
1457
|
+
}
|
|
1458
|
+
function PostalAddressSchema({ data }) {
|
|
1459
|
+
return /* @__PURE__ */ jsx21(SchemaOrgScript, { jsonLd: buildPostalAddressJsonLd(data) });
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
// src/schema/product/component.tsx
|
|
1463
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1464
|
+
function buildProductJsonLd(data) {
|
|
1465
|
+
return buildGenericJsonLd(
|
|
1466
|
+
"Product",
|
|
1467
|
+
data,
|
|
1468
|
+
productFields,
|
|
1469
|
+
["name"]
|
|
1470
|
+
);
|
|
1471
|
+
}
|
|
1472
|
+
function ProductSchema({ data }) {
|
|
1473
|
+
return /* @__PURE__ */ jsx22(SchemaOrgScript, { jsonLd: buildProductJsonLd(data) });
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// src/schema/review/component.tsx
|
|
1477
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1478
|
+
function buildReviewJsonLd(data) {
|
|
1479
|
+
return buildGenericJsonLd(
|
|
1480
|
+
"Review",
|
|
1481
|
+
data,
|
|
1482
|
+
reviewFields,
|
|
1483
|
+
[]
|
|
1484
|
+
);
|
|
1485
|
+
}
|
|
1486
|
+
function ReviewSchema({ data }) {
|
|
1487
|
+
return /* @__PURE__ */ jsx23(SchemaOrgScript, { jsonLd: buildReviewJsonLd(data) });
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
// src/schema/softwareApplication/component.tsx
|
|
1491
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1492
|
+
function buildSoftwareApplicationJsonLd(data) {
|
|
1493
|
+
return buildGenericJsonLd(
|
|
1494
|
+
"SoftwareApplication",
|
|
1495
|
+
data,
|
|
1496
|
+
softwareApplicationFields,
|
|
1497
|
+
["name"]
|
|
1498
|
+
);
|
|
1499
|
+
}
|
|
1500
|
+
function SoftwareApplicationSchema({
|
|
1501
|
+
data
|
|
1502
|
+
}) {
|
|
1503
|
+
return /* @__PURE__ */ jsx24(SchemaOrgScript, { jsonLd: buildSoftwareApplicationJsonLd(data) });
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
// src/schema/videoObject/component.tsx
|
|
1507
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1508
|
+
function buildVideoObjectJsonLd(data) {
|
|
1509
|
+
return buildGenericJsonLd(
|
|
1510
|
+
"VideoObject",
|
|
1511
|
+
data,
|
|
1512
|
+
videoObjectFields,
|
|
1513
|
+
["name"]
|
|
1514
|
+
);
|
|
1515
|
+
}
|
|
1516
|
+
function VideoObjectSchema({ data }) {
|
|
1517
|
+
return /* @__PURE__ */ jsx25(SchemaOrgScript, { jsonLd: buildVideoObjectJsonLd(data) });
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
// src/schema/webApplication/component.tsx
|
|
1521
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1522
|
+
function buildWebApplicationJsonLd(data) {
|
|
1523
|
+
return buildGenericJsonLd(
|
|
1524
|
+
"WebApplication",
|
|
1525
|
+
data,
|
|
1526
|
+
webApplicationFields,
|
|
1527
|
+
["name", "url"]
|
|
1528
|
+
);
|
|
1529
|
+
}
|
|
1530
|
+
function WebApplicationSchema({ data }) {
|
|
1531
|
+
return /* @__PURE__ */ jsx26(SchemaOrgScript, { jsonLd: buildWebApplicationJsonLd(data) });
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
// src/schema/webPage/component.tsx
|
|
1535
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1536
|
+
function buildWebPageJsonLd(data) {
|
|
1537
|
+
return buildGenericJsonLd(
|
|
1538
|
+
"WebPage",
|
|
1539
|
+
data,
|
|
1540
|
+
webPageFields,
|
|
1541
|
+
["name", "url"]
|
|
1542
|
+
);
|
|
1543
|
+
}
|
|
1544
|
+
function WebPageSchema({ data }) {
|
|
1545
|
+
return /* @__PURE__ */ jsx27(SchemaOrgScript, { jsonLd: buildWebPageJsonLd(data) });
|
|
1546
|
+
}
|
|
139
1547
|
export {
|
|
1548
|
+
AggregateRatingSchema,
|
|
1549
|
+
ArticleSchema,
|
|
1550
|
+
BlogPostingSchema,
|
|
1551
|
+
BrandSchema,
|
|
1552
|
+
BreadcrumbListSchema,
|
|
1553
|
+
ContactPointSchema,
|
|
1554
|
+
CourseSchema,
|
|
1555
|
+
EventSchema,
|
|
1556
|
+
FAQPageSchema,
|
|
1557
|
+
HowToSchema,
|
|
1558
|
+
ImageObjectSchema,
|
|
1559
|
+
LocalBusinessSchema,
|
|
1560
|
+
OfferSchema,
|
|
1561
|
+
OrganizationSchema,
|
|
1562
|
+
PersonSchema,
|
|
1563
|
+
PlaceSchema,
|
|
1564
|
+
PostalAddressSchema,
|
|
1565
|
+
ProductSchema,
|
|
1566
|
+
ReviewSchema,
|
|
1567
|
+
SchemaOrgScripts,
|
|
140
1568
|
SeoMetaTags,
|
|
1569
|
+
SoftwareApplicationSchema,
|
|
1570
|
+
VideoObjectSchema,
|
|
1571
|
+
WebApplicationSchema,
|
|
1572
|
+
WebPageSchema,
|
|
1573
|
+
WebsiteSchema,
|
|
1574
|
+
buildAggregateRatingJsonLd,
|
|
1575
|
+
buildArticleJsonLd,
|
|
1576
|
+
buildBlogPostingJsonLd,
|
|
1577
|
+
buildBrandJsonLd,
|
|
1578
|
+
buildBreadcrumbListJsonLd,
|
|
1579
|
+
buildContactPointJsonLd,
|
|
1580
|
+
buildCourseJsonLd,
|
|
1581
|
+
buildEventJsonLd,
|
|
1582
|
+
buildFAQPageJsonLd,
|
|
1583
|
+
buildHowToJsonLd,
|
|
1584
|
+
buildImageObjectJsonLd,
|
|
1585
|
+
buildLocalBusinessJsonLd,
|
|
1586
|
+
buildOfferJsonLd,
|
|
1587
|
+
buildOrganizationJsonLd,
|
|
1588
|
+
buildPersonJsonLd,
|
|
1589
|
+
buildPlaceJsonLd,
|
|
1590
|
+
buildPostalAddressJsonLd,
|
|
1591
|
+
buildProductJsonLd,
|
|
1592
|
+
buildReviewJsonLd,
|
|
141
1593
|
buildSeoMeta,
|
|
1594
|
+
buildSoftwareApplicationJsonLd,
|
|
1595
|
+
buildVideoObjectJsonLd,
|
|
1596
|
+
buildWebApplicationJsonLd,
|
|
1597
|
+
buildWebPageJsonLd,
|
|
1598
|
+
buildWebsiteJsonLd,
|
|
142
1599
|
sanitizeOGType,
|
|
143
1600
|
sanitizeTwitterCard
|
|
144
1601
|
};
|