Skip to content

Commit bf40c89

Browse files
committed
chore(site): amend schema
1 parent 5028ead commit bf40c89

File tree

1 file changed

+0
-68
lines changed

1 file changed

+0
-68
lines changed

site/src/lib/schema.ts

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export function buildSchemas(route: StarlightRouteData) {
1717
schemas.push(buildWebSiteSchema());
1818
schemas.push(buildPersonSchema());
1919
schemas.push(buildSoftwareApplicationSchema());
20-
schemas.push(buildWebPageSchema(route));
2120
}
2221

2322
if (isDocPage) {
@@ -54,10 +53,6 @@ function buildPersonSchema() {
5453
url: siteConfig.authorUrl,
5554
image: siteConfig.authorImage,
5655
sameAs: siteConfig.authorSocial,
57-
funding: {
58-
'@type': 'MonetaryGrant',
59-
url: siteConfig.sponsorUrl,
60-
},
6156
};
6257
}
6358

@@ -80,63 +75,10 @@ function buildSoftwareApplicationSchema() {
8075
name: siteConfig.authorName,
8176
url: siteConfig.authorUrl,
8277
},
83-
funding: siteConfig.sponsorUrl,
8478
downloadUrl: siteConfig.npmUrl,
8579
};
8680
}
8781

88-
/**
89-
* WebPage schema for homepage with mainEntity ItemList derived from the TOC.
90-
* The ItemList tells Google which sections are the primary content, increasing
91-
* the likelihood of fragment "jump-to" buttons in search results.
92-
* https://schema.org/WebPage
93-
* https://schema.org/ItemList
94-
*/
95-
function buildWebPageSchema(route: StarlightRouteData) {
96-
// Flatten TocItem tree into a position-ordered list, skipping the synthetic
97-
// "Overview" entry (slug === '_top') which is not a real heading.
98-
const items: Array<{ position: number; name: string; url: string }> = [];
99-
100-
function collectItems(tocItems: any[]) {
101-
for (const item of tocItems) {
102-
if (item.slug !== '_top') {
103-
items.push({
104-
position: items.length + 1,
105-
name: item.text,
106-
url: `${siteConfig.siteUrl}/#${item.slug}`,
107-
});
108-
}
109-
if (item.children?.length) {
110-
collectItems(item.children);
111-
}
112-
}
113-
}
114-
115-
const tocItems = route.toc?.items ?? [];
116-
collectItems(tocItems);
117-
118-
return {
119-
'@context': 'https://schema.org',
120-
'@type': 'WebPage',
121-
name: siteConfig.siteName,
122-
url: siteConfig.siteUrl,
123-
description: siteConfig.description,
124-
mainEntity: {
125-
'@type': 'ItemList',
126-
name: 'On this page',
127-
itemListElement: items.map(({ position, name, url }) => ({
128-
'@type': 'ListItem',
129-
position,
130-
item: {
131-
'@type': 'WebPageElement',
132-
name,
133-
url,
134-
},
135-
})),
136-
},
137-
};
138-
}
139-
14082
/**
14183
* BreadcrumbList schema for documentation pages.
14284
* https://schema.org/BreadcrumbList
@@ -168,9 +110,6 @@ function buildArticleSchema(route: StarlightRouteData) {
168110
// Starlight provides lastUpdated from Git when lastUpdated: true in config
169111
const dateModified = data.lastUpdated?.toISOString() || new Date().toISOString();
170112

171-
// Use the OG image for this specific page
172-
const ogImageUrl = `${siteConfig.siteUrl}/og/${route.id}.png`;
173-
174113
return {
175114
'@context': 'https://schema.org',
176115
'@type': 'Article',
@@ -183,13 +122,6 @@ function buildArticleSchema(route: StarlightRouteData) {
183122
name: siteConfig.authorName,
184123
url: siteConfig.authorUrl,
185124
},
186-
publisher: {
187-
'@type': 'Person',
188-
name: siteConfig.authorName,
189-
url: siteConfig.authorUrl,
190-
image: siteConfig.authorImage,
191-
},
192-
image: ogImageUrl,
193125
inLanguage: 'en',
194126
};
195127
}

0 commit comments

Comments
 (0)