openvibers/openvibe.work Commits

Work: the home page's meta description says what the site does (#41)

OP OpenVibers committed 29 days ago · 9428766fc3 · 2 files, +4 −0

The home page's meta description was the layout's fallback, "OpenVibe.Work — <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 0d61f9a..20906cd 100644
---- a/server/http/pages.js
++++ b/server/http/pages.js
@@@ -120,6 +120,7 @@ ${facets.type.map((t) => link({ type: t.type }, t.type, filters.type === t.type,
});
page(req, res, {
index: true, cache: signedIn(req) ? null : PUBLIC_CACHE,
++ description: 'Jobs from open job boards, each saying where it came from and when, with saved searches, alerts through OpenVibe.Watch and an application tracker.',
jsonLd: homeJsonLd(config),
styles: [showcase.STYLESHEET],
body: html`${raw(hero)}
@@@ -607,6 +608,7 @@ ${raw(showcase.code({ title: 'Search, then read one', samples: [{ label: 'bash',
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.Work, newest first, from the OpenVibe network\'s shared update log.',
body: raw(frame.updatesBody({ service: 'work', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`),
}));
ddiff --git a/test/discovery.test.js b/test/discovery.test.js
iindex a81901d..380c363 100644
---- a/test/discovery.test.js
++++ b/test/discovery.test.js
@@@ -75,6 +75,8 @@ const PRIVATE = ['/auth/', '/api/'];
await check('home page: WebSite + the site\'s primary type, the same for every crawler', 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 blocks = [...r.text.matchAll(/<script type="application\/ld\+json">([\s\S]*?)<\/script>/g)].map((m) => JSON.parse(m[1]));
const types = blocks.map((b) => b['@type']);