openvibers/openvibe.media Commits

Add WebSite + Organization JSON-LD to the home page (#264)

OP OpenVibers committed 12 days ago · a4377e697f · 3 files, +4 −1

Changes

ddiff --git a/server/public/browse.js b/server/public/browse.js
iindex f2e94a2..873abe5 100644
---- a/server/public/browse.js
++++ b/server/public/browse.js
@@@ -202,6 +202,7 @@ function browseJsonLd(tab, cards) {
const items = cards.map((c) => ({ name: c.title || 'Untitled', url: abs(c.view) })).filter((it) => it.url);
return [
tab === 'all' ? seo.jsonLd.website({ name: 'OpenVibe.Media', url: `${config.publicUrl}/`, description: 'Every public file on the OpenVibe network: videos, clips, files and thumbnails.' }) : null,
++ tab === 'all' ? seo.jsonLd.organization() : null,
items.length ? seo.jsonLd.itemList(tab === 'all' ? 'Latest public media' : `Latest public ${tab}`, items, { url: `${config.publicUrl}/${tab === 'all' ? '' : `?tab=${tab}`}` }) : null,
].filter(Boolean);
}
ddiff --git a/test/perf-budget.test.js b/test/perf-budget.test.js
iindex 2a04680..4c7f91f 100644
---- a/test/perf-budget.test.js
++++ b/test/perf-budget.test.js
@@@ -13,7 +13,7 @@ const { measure, check, format } = require('openvibe-shared/perf-budget');
(async () => {
const BUDGETS = {
-- htmlRawKB: 51, // 50.1 with openvibe-shared 4.59.0: the Pair mark beside the name, set in the brand face (2026-10-31); 48.6 with the phone pick block and folds (2026-10-30; a fresh database measures a little larger); 43.8 openvibe-shared 4.22.0: the navbar's magnifier search button and More dropdown (search.js and loading.js load only when used); measured 38.8 on 2026-10-22 (fresh database): the home gained its developer half (what it does, code, limits, questions and their FAQPage data); 19.8 before
++ htmlRawKB: 51.8, // 2026-11-01: WebSite + Organization JSON-LD; 50.1 with openvibe-shared 4.59.0: the Pair mark beside the name, set in the brand face (2026-10-31); 48.6 with the phone pick block and folds (2026-10-30; a fresh database measures a little larger); 43.8 openvibe-shared 4.22.0: the navbar's magnifier search button and More dropdown (search.js and loading.js load only when used); measured 38.8 on 2026-10-22 (fresh database): the home gained its developer half (what it does, code, limits, questions and their FAQPage data); 19.8 before
htmlBrotliKB: 12.3, // 12.1 with openvibe-shared 4.66.0: the mark with depth and motion, ov-fx loaded on request (2026-10-31); 10.8 openvibe-shared 4.22.0: the navbar's magnifier search button and More dropdown (search.js and loading.js load only when used); 9.7 on 2026-10-22; 5.0 before
jsFiles: 4, // 3
// 2026-09-27: theme-loader (44.3 KB, 8.3 brotli) now comes from Media's own /shared (D42) instead of
ddiff --git a/test/public-pages.test.js b/test/public-pages.test.js
iindex ad38864..b07053b 100644
---- a/test/public-pages.test.js
++++ b/test/public-pages.test.js
@@@ -166,6 +166,8 @@ const http = require('http');
assert.strictEqual(r.status, 200);
const ld = [...r.body.matchAll(/<script type="application\/ld\+json">([\s\S]*?)<\/script>/g)].flatMap((m) => JSON.parse(m[1])['@graph'] || []);
assert.ok(ld.some((x) => x['@type'] === 'WebSite'), 'the index names the site');
++ const org = ld.find((x) => x['@type'] === 'Organization');
++ assert.ok(org && Array.isArray(org.sameAs) && org.sameAs.includes('https://github.com/OpenVibers'), 'the index names the OpenVibe Organization');
const list = ld.find((x) => x['@type'] === 'ItemList');
assert.ok(list && list.itemListElement.length >= 1 && list.itemListElement.every((it) => /^https?:\/\//.test(it.url)), 'the listed cards, with absolute URLs');
const h1s = (html) => (html.match(/<h1[\s>]/g) || []).length;