openvibers/openvibe.games Commits

Add Organization JSON-LD to the home page (#244)

OP OpenVibers committed 12 days ago · f70f163700 · 2 files, +4 −1

* Add Organization JSON-LD alongside the home WebSite

* Type the Organization builder in the SEO toolkit

Changes

ddiff --git a/apps/server/src/net/discovery.test.ts b/apps/server/src/net/discovery.test.ts
iindex a29c421..232c7b4 100644
---- a/apps/server/src/net/discovery.test.ts
++++ b/apps/server/src/net/discovery.test.ts
@@@ -232,6 +232,7 @@ describe('crawl artifacts (plan T11)', () => {
]
expect(blocks.map((b) => (JSON.parse(b[1] ?? '{}') as { '@type'?: string })['@type'])).toEqual([
'WebSite',
++ 'Organization',
'WebApplication',
// Vibe Heroes, the casual line's first game (plan T22).
'WebApplication',
@@@ -239,7 +240,7 @@ describe('crawl artifacts (plan T11)', () => {
])
const nodes = blocks.map((b) => JSON.parse(b[1] ?? '{}') as Record<string, unknown>)
expect(nodes[0]?.['url']).toBe('https://openvibe.games')
-- expect(nodes[1]?.['applicationCategory']).toBe('GameApplication')
++ expect(nodes[2]?.['applicationCategory']).toBe('GameApplication')
// Nothing private or per-user in the served nodes.
const text = JSON.stringify(nodes)
for (const p of PRIVATE) expect(text).not.toContain(p)
ddiff --git a/apps/server/src/net/discovery.ts b/apps/server/src/net/discovery.ts
iindex 8548ff1..4d535a6 100644
---- a/apps/server/src/net/discovery.ts
++++ b/apps/server/src/net/discovery.ts
@@@ -64,6 +64,7 @@ interface SeoToolkit {
sitemapXml(urls: SeoUrl[]): string
jsonLd: {
website(o: { name: string; url: string; description: string }): unknown
++ organization(o?: Record<string, unknown>): unknown
softwareApp(o: {
name: string
url: string
@@@ -296,6 +297,7 @@ function llmsFullBody(): string {
export function homeJsonLd(): unknown[] {
return [
seo.jsonLd.website({ name: SITE_NAME, url: SITE, description: DESCRIPTION }),
++ seo.jsonLd.organization(),
seo.jsonLd.softwareApp({
name: 'Scraplandia',
url: `${PLAY}/`,