pagesight 0.8.0 → 0.9.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/package.json +1 -1
- package/src/tools/metatags.ts +22 -1
package/package.json
CHANGED
package/src/tools/metatags.ts
CHANGED
|
@@ -275,6 +275,26 @@ function validateJsonLd(blocks: unknown[]): { issues: ValidationIssue[]; imageUr
|
|
|
275
275
|
return { issues, imageUrls };
|
|
276
276
|
}
|
|
277
277
|
|
|
278
|
+
// What each recommended field enables (sourced from Google Rich Results docs)
|
|
279
|
+
const FIELD_HINTS: Record<string, string> = {
|
|
280
|
+
"WebSite.potentialAction": "enables sitelinks searchbox",
|
|
281
|
+
"Organization.logo": "appears in knowledge panel",
|
|
282
|
+
"Organization.contactPoint": "may appear in knowledge panel",
|
|
283
|
+
"Organization.sameAs": "links social profiles in knowledge panel",
|
|
284
|
+
"Article.dateModified": "shows freshness in search results",
|
|
285
|
+
"Article.publisher": "required for some article rich results",
|
|
286
|
+
"Product.offers": "enables price display in search",
|
|
287
|
+
"Product.review": "enables star ratings in search",
|
|
288
|
+
"Product.aggregateRating": "enables aggregate star ratings",
|
|
289
|
+
"Product.brand": "shown in product rich results",
|
|
290
|
+
"LocalBusiness.openingHoursSpecification": "shows business hours in maps",
|
|
291
|
+
"LocalBusiness.image": "shown in local pack results",
|
|
292
|
+
"Event.image": "shown in event rich results",
|
|
293
|
+
"Event.offers": "shows ticket prices in search",
|
|
294
|
+
"Recipe.author": "shown in recipe rich results",
|
|
295
|
+
"VideoObject.duration": "shown in video rich results",
|
|
296
|
+
};
|
|
297
|
+
|
|
278
298
|
function formatValidation(issues: ValidationIssue[]): string[] {
|
|
279
299
|
if (issues.length === 0) return ["All validated types have their required fields."];
|
|
280
300
|
|
|
@@ -289,7 +309,8 @@ function formatValidation(issues: ValidationIssue[]): string[] {
|
|
|
289
309
|
}
|
|
290
310
|
if (recommended.length > 0) {
|
|
291
311
|
for (const i of recommended) {
|
|
292
|
-
|
|
312
|
+
const hint = FIELD_HINTS[`${i.type}.${i.field}`];
|
|
313
|
+
lines.push(`OPTIONAL ${i.type}.${i.field}${hint ? ` — ${hint}` : ""}`);
|
|
293
314
|
}
|
|
294
315
|
}
|
|
295
316
|
|