(data: {
name: string;
description: string;
url: string;
tools: Array<{ name: string; url: string }>;
})
| 97 | * Generate CollectionPage structured data for category and collection pages |
| 98 | */ |
| 99 | export function createCollectionPageSchema(data: { |
| 100 | name: string; |
| 101 | description: string; |
| 102 | url: string; |
| 103 | tools: Array<{ name: string; url: string }>; |
| 104 | }): WithContext<CollectionPage> { |
| 105 | return { |
| 106 | '@context': 'https://schema.org', |
| 107 | '@type': 'CollectionPage', |
| 108 | name: data.name, |
| 109 | description: data.description, |
| 110 | url: data.url, |
| 111 | mainEntity: { |
| 112 | '@type': 'ItemList', |
| 113 | numberOfItems: data.tools.length, |
| 114 | itemListElement: data.tools.slice(0, 10).map((tool, index) => ({ |
| 115 | '@type': 'ListItem' as const, |
| 116 | position: index + 1, |
| 117 | name: tool.name, |
| 118 | url: tool.url, |
| 119 | })), |
| 120 | }, |
| 121 | }; |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * Generate FAQPage structured data for category pages |
nothing calls this directly
no outgoing calls
no test coverage detected