openvibers/openvibe.report Commits
Add WebSite + Organization JSON-LD to the home page (#53)
Changes
@@@ -12,6 +12,7 @@ const shell = require('openvibe-shared/shell');const ovServe = require('openvibe-shared/serve');const appIcon = require('openvibe-shared/app-icon');const kit = require('openvibe-shared/kit');++const seo = require('openvibe-shared/seo');// The short home (the owner's rule, 2026-10-30): pick blocks and folds.const { pickList, pickListRules, foldAround } = require('./short');// A short name for a chip: the title, cut where it stops saying anything.@@@ -254,6 +255,7 @@ function home({ stats, rundown, topics } = {}) {out = foldAround(out, '>Questions</h2>', 'faq', '<h2 id="rp-faq-h">Questions</h2>');return layout({title: null, body: out, active: '/', path: '/', agent: true,++ jsonLd: [seo.jsonLd.website({ name: 'OpenVibe.Report', url: 'https://openvibe.report/', description: "The network's numbers open to everyone, what streamers talked about in The Rundown, and every stream's after-show report." }), seo.jsonLd.organization()],// The rule that shows the picked topic of the pick list: one per topic, written for this page.inlineStyles: [`@supports selector(:has(*)){@media (max-width:640px){${pickListRules('topics', trending.length)}}}`],});@@@ -32,6 +32,14 @@ const { boot, check, done, defaults } = require('./helpers/boot');});}++ await check('the home has WebSite and Organization JSON-LD', async () => {++ const r = await t.get('/');++ const ld = [...r.text.matchAll(/<script type="application\/ld\+json">([\s\S]*?)<\/script>/g)].map((m) => JSON.parse(m[1])).flatMap((b) => b['@graph'] || [b]);++ assert.ok(ld.some((x) => x['@type'] === 'WebSite'), 'WebSite');++ const org = ld.find((x) => x['@type'] === 'Organization');++ assert.ok(org && Array.isArray(org.sameAs) && org.sameAs.includes('https://github.com/OpenVibers'), 'Organization');++ });++await check('a page names its canonical and mounts the Frame for service report', async () => {const r = await t.get('/rundown/t/seattle');assert.ok(r.text.includes('<link rel="canonical" href="https://openvibe.report/rundown/t/seattle">'));
@@ -12,6 +12,7 @@ const shell = require('openvibe-shared/shell');
@@ -12,6 +12,7 @@ const shell = require('openvibe-shared/shell');
const ovServe = require('openvibe-shared/serve');
const ovServe = require('openvibe-shared/serve');
const appIcon = require('openvibe-shared/app-icon');
const appIcon = require('openvibe-shared/app-icon');
const kit = require('openvibe-shared/kit');
const kit = require('openvibe-shared/kit');
+const seo = require('openvibe-shared/seo');
// The short home (the owner's rule, 2026-10-30): pick blocks and folds.
// The short home (the owner's rule, 2026-10-30): pick blocks and folds.
const { pickList, pickListRules, foldAround } = require('./short');
const { pickList, pickListRules, foldAround } = require('./short');
// A short name for a chip: the title, cut where it stops saying anything.
// A short name for a chip: the title, cut where it stops saying anything.
@@ -254,6 +255,7 @@ function home({ stats, rundown, topics } = {}) {
@@ -254,6 +255,7 @@ function home({ stats, rundown, topics } = {}) {
out = foldAround(out, '>Questions</h2>', 'faq', '<h2 id="rp-faq-h">Questions</h2>');
out = foldAround(out, '>Questions</h2>', 'faq', '<h2 id="rp-faq-h">Questions</h2>');
return layout({
return layout({
title: null, body: out, active: '/', path: '/', agent: true,
title: null, body: out, active: '/', path: '/', agent: true,
+ jsonLd: [seo.jsonLd.website({ name: 'OpenVibe.Report', url: 'https://openvibe.report/', description: "The network's numbers open to everyone, what streamers talked about in The Rundown, and every stream's after-show report." }), seo.jsonLd.organization()],
// The rule that shows the picked topic of the pick list: one per topic, written for this page.
// The rule that shows the picked topic of the pick list: one per topic, written for this page.
inlineStyles: [`@supports selector(:has(*)){@media (max-width:640px){${pickListRules('topics', trending.length)}}}`],
inlineStyles: [`@supports selector(:has(*)){@media (max-width:640px){${pickListRules('topics', trending.length)}}}`],
});
});
@@ -32,6 +32,14 @@ const { boot, check, done, defaults } = require('./helpers/boot');
@@ -32,6 +32,14 @@ const { boot, check, done, defaults } = require('./helpers/boot');
});
});
}
}
+ await check('the home has WebSite and Organization JSON-LD', async () => {
+ const r = await t.get('/');
+ const ld = [...r.text.matchAll(/<script type="application\/ld\+json">([\s\S]*?)<\/script>/g)].map((m) => JSON.parse(m[1])).flatMap((b) => b['@graph'] || [b]);
+ assert.ok(ld.some((x) => x['@type'] === 'WebSite'), 'WebSite');
+ const org = ld.find((x) => x['@type'] === 'Organization');
+ assert.ok(org && Array.isArray(org.sameAs) && org.sameAs.includes('https://github.com/OpenVibers'), 'Organization');
+ });
+
await check('a page names its canonical and mounts the Frame for service report', async () => {
await check('a page names its canonical and mounts the Frame for service report', async () => {
const r = await t.get('/rundown/t/seattle');
const r = await t.get('/rundown/t/seattle');
assert.ok(r.text.includes('<link rel="canonical" href="https://openvibe.report/rundown/t/seattle">'));
assert.ok(r.text.includes('<link rel="canonical" href="https://openvibe.report/rundown/t/seattle">'));