openvibers/openvibe.work Commits
Work: the home page's meta description says what the site does (#41)
Changes
@@@ -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>`),}));@@@ -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']);
@@ -120,6 +120,7 @@ ${facets.type.map((t) => link({ type: t.type }, t.type, filters.type === t.type,
@@ -120,6 +120,7 @@ ${facets.type.map((t) => link({ type: t.type }, t.type, filters.type === t.type,
});
});
page(req, res, {
page(req, res, {
index: true, cache: signedIn(req) ? null : PUBLIC_CACHE,
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),
jsonLd: homeJsonLd(config),
styles: [showcase.STYLESHEET],
styles: [showcase.STYLESHEET],
body: html`${raw(hero)}
body: html`${raw(hero)}
@@ -607,6 +608,7 @@ ${raw(showcase.code({ title: 'Search, then read one', samples: [{ label: 'bash',
@@ -607,6 +608,7 @@ ${raw(showcase.code({ title: 'Search, then read one', samples: [{ label: 'bash',
r.get('/updates', (req, res) => page(req, res, {
r.get('/updates', (req, res) => page(req, res, {
index: true, cache: PUBLIC_CACHE,
index: true, cache: PUBLIC_CACHE,
title: `What shipped on ${SITE_NAME}`,
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>`),
body: raw(frame.updatesBody({ service: 'work', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`),
}));
}));
@@ -75,6 +75,8 @@ const PRIVATE = ['/auth/', '/api/'];
@@ -75,6 +75,8 @@ const PRIVATE = ['/auth/', '/api/'];
await check('home page: WebSite + the site\'s primary type, the same for every crawler', async () => {
await check('home page: WebSite + the site\'s primary type, the same for every crawler', async () => {
const r = await t.get('/');
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);
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 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']);
const types = blocks.map((b) => b['@type']);