openvibers/openvibe.quest Commits

Quest: the home page's meta description says what the site does (#42)

OP OpenVibers committed 29 days ago · 8bca55e425 · 2 files, +4 −0

The home page's meta description was the layout's fallback, "OpenVibe.Quest — <tagline>" (35-49 characters). A metadata audit of every site flagged it as too short for search results.

- **Home:** it is now a sentence saying what the site does, under 160 characters.
- **/updates:** gets its own description instead of the same fallback.

The home test checks the description is 50-160 characters and is not "Name — tagline".

Changes

ddiff --git a/server/http/pages.js b/server/http/pages.js
iindex ab90c3d..0713db2 100644
---- a/server/http/pages.js
++++ b/server/http/pages.js
@@@ -62,6 +62,7 @@ function createPageRoutes(ctx) {
});
page(req, res, {
index: true, cache: signedIn(req) ? null : PUBLIC_CACHE,
++ description: 'One quest log across the OpenVibe sites: badges for what you really do on Live, Chat, Community, Games and more, built on real activity.',
jsonLd: homeJsonLd(config),
styles: [showcase.STYLESHEET],
body: html`${raw(hero)}
@@@ -247,6 +248,7 @@ when their Network account is deleted or merged. Until it does, progress rows st
r.get('/updates', (req, res) => page(req, res, {
index: true, cache: PUBLIC_CACHE,
title: `What shipped on ${SITE_NAME}`,
++ description: 'Every change deployed to OpenVibe.Quest, newest first, from the OpenVibe network\'s shared update log.',
body: raw(frame.updatesBody({ service: 'quest', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`),
}));
ddiff --git a/test/layout.test.js b/test/layout.test.js
iindex 1fa2fed..00c9887 100644
---- a/test/layout.test.js
++++ b/test/layout.test.js
@@@ -35,6 +35,8 @@ const BOOST = /<script src="\/shared\/boost\.js\?v=[0-9a-f]{12}" data-main="#mai
await check('the home page head comes from openvibe-shared/shell with the same title, canonical, robots and JSON-LD', async () => {
const r = await t.get('/');
++ // The home's meta description is a sentence for search results (50-160 characters), not "Name — tagline".
++ { const d = (/<meta name="description" content="([^"]*)"/.exec(r.text) || [])[1] || ''; assert.ok(d.length >= 50 && d.length <= 160 && !d.includes(' — '), `home description: ${d}`); }
assert.strictEqual(r.status, 200);
const head = r.text.slice(0, r.text.indexOf('</head>'));
assert.strictEqual((r.text.match(/<title>/g) || []).length, 1, 'exactly one <title>');