openvibers/openvibe.quest Commits
Quest: the home page's meta description says what the site does (#42)
Changes
@@@ -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 str.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>`),}));@@@ -35,6 +35,8 @@ const BOOST = /<script src="\/shared\/boost\.js\?v=[0-9a-f]{12}" data-main="#maiawait 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>');
@@ -62,6 +62,7 @@ function createPageRoutes(ctx) {
@@ -62,6 +62,7 @@ function createPageRoutes(ctx) {
});
});
page(req, res, {
page(req, res, {
index: true, cache: signedIn(req) ? null : PUBLIC_CACHE,
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),
jsonLd: homeJsonLd(config),
styles: [showcase.STYLESHEET],
styles: [showcase.STYLESHEET],
body: html`${raw(hero)}
body: html`${raw(hero)}
@@ -247,6 +248,7 @@ when their Network account is deleted or merged. Until it does, progress rows st
@@ -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, {
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.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>`),
body: raw(frame.updatesBody({ service: 'quest', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`),
}));
}));
@@ -35,6 +35,8 @@ const BOOST = /<script src="\/shared\/boost\.js\?v=[0-9a-f]{12}" data-main="#mai
@@ -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 () => {
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('/');
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 head = r.text.slice(0, r.text.indexOf('</head>'));
const head = r.text.slice(0, r.text.indexOf('</head>'));
assert.strictEqual((r.text.match(/<title>/g) || []).length, 1, 'exactly one <title>');
assert.strictEqual((r.text.match(/<title>/g) || []).length, 1, 'exactly one <title>');