openvibers/openvibe.connect Commits

Front door: carry the site entity as JSON-LD (#116)

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

Changes

ddiff --git a/server/render/layout.js b/server/render/layout.js
iindex 8542793..fe460fe 100644
---- a/server/render/layout.js
++++ b/server/render/layout.js
@@@ -10,6 +10,7 @@ const fs = require('fs');
const path = require('path');
const appIcon = require('openvibe-shared/app-icon');
const shell = require('openvibe-shared/shell');
++const seo = require('openvibe-shared/seo');
const rooms = require('openvibe-shared/rooms');
const ovServe = require('openvibe-shared/serve');
const cache = require('openvibe-shared/cache-policy');
@@@ -77,7 +78,7 @@ function layout(o) {
description: o.description || `${SITE_NAME}: ${TAGLINE} Share one port on your computer at its own address, behind OpenVibe sign-in.`,
canonical,
robots: o.robots || (o.index ? 'index, follow' : 'noindex, follow'),
-- jsonLd: (o.jsonLd || []).filter(Boolean),
++ jsonLd: (o.jsonLd || [seo.jsonLd.website({ name: SITE_NAME, url: `${config.baseUrl}/`, description: `${SITE_NAME}: ${TAGLINE}` })]).filter(Boolean),
home: '/',
navLinks: NAV,
navbar,
ddiff --git a/test/pages.test.js b/test/pages.test.js
iindex 73db190..7ad31ff 100644
---- a/test/pages.test.js
++++ b/test/pages.test.js
@@@ -21,6 +21,8 @@ const { check, done } = require('./helpers/check');
assert.match(r.text, /Sign in to make a share/);
assert.ok(!r.text.includes('action="/shares"'));
assert.match(r.text, /<meta name="robots" content="index, follow"/);
++ assert.match(r.text, /<script type="application\/ld\+json">[^<]*"@type":"WebSite"/, 'the front door carries the site entity');
++ assert.match(r.text, /"name":"OpenVibe Connect"/);
});
await check('signed in: your shares and the form, with your own address in it', async () => {