openvibers/openvibe.studio Commits

Home: carry the site entity as JSON-LD (#48)

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

Changes

ddiff --git a/server/layout.js b/server/layout.js
iindex 35da402..01b85c7 100644
---- a/server/layout.js
++++ b/server/layout.js
@@@ -1,6 +1,7 @@
'use strict';
const shell = require('openvibe-shared/shell');
const serve = require('openvibe-shared/serve');
++const seo = require('openvibe-shared/seo');
const NAV = [
{ label: 'Home', href: '/' },
{ label: 'Photo', href: '/photo' },
@@@ -9,7 +10,7 @@ const NAV = [
function page({ title, body, viewer, config, path = '/' }) {
const nav = { service: 'studio', apiBase: config.networkUrl, links: NAV.map((x) => ({ ...x, active: path === x.href })), history: { type: 'page', title }, silentLogin: `${config.baseUrl}/auth/login?silent=1&next={url}`, sessionUrl: '/auth/me', loginUrl: '/auth/login?next={path}', logoutUrl: '/auth/logout?next={path}' };
const footer = { service: 'studio', variant: 'full', brandName: 'OpenVibe.Studio' };
-- return shell.page({ name: 'OpenVibe.Studio', lang: 'en', title: `${title} · OpenVibe.Studio`, titleSuffix: '', siteName: 'OpenVibe.Studio', description: 'Photo and Light, the creative apps on the OpenVibe network.', canonical: `${config.baseUrl}${path}`, robots: 'index, follow', home: '/', navLinks: NAV, navbar: nav, footer,
++ return shell.page({ name: 'OpenVibe.Studio', lang: 'en', title: `${title} · OpenVibe.Studio`, titleSuffix: '', siteName: 'OpenVibe.Studio', description: 'Photo and Light, the creative apps on the OpenVibe network.', canonical: `${config.baseUrl}${path}`, robots: 'index, follow', jsonLd: [seo.jsonLd.website({ name: 'OpenVibe.Studio', url: `${config.baseUrl}/`, description: 'Photo and Light, the creative apps on the OpenVibe network.' })], home: '/', navLinks: NAV, navbar: nav, footer,
head: `<link rel="stylesheet" href="${serve.url('kit.css')}"><link rel="stylesheet" href="/css/studio.css"><meta name="referrer" content="strict-origin-when-cross-origin">`,
body: `<div id="navbar-mount"></div><main id="main" class="studio-page">${body}</main>` });
}
ddiff --git a/test/studio.test.js b/test/studio.test.js
iindex e6792e7..8da829f 100644
---- a/test/studio.test.js
++++ b/test/studio.test.js
@@@ -109,6 +109,8 @@ test('the home names both apps, their limits and their licences', async (t) => {
const res = await fetch(s.base);
assert.equal(res.status, 200);
const html = await res.text();
++ assert.match(html, /<script type="application\/ld\+json">[^<]*"@type":"WebSite"/, 'the home carries the site entity for search engines');
++ assert.match(html, /"name":"OpenVibe\.Studio"/);
assert.match(html, /PhotoCraft/);
assert.match(html, /LightCraft/);
assert.match(html, /Good to know/);