openvibers/openvibe.food Commits
Food: the home page's meta description says what the site does (#41)
Changes
@@@ -103,6 +103,7 @@ ${res_.phone ? html`<p class="small">Phone: <a href="tel:${String(res_.phone).re});page(req, res, {index: true, cache: signedIn(req) ? null : PUBLIC_CACHE,++ description: 'Find food banks and budget grocers near you, plan meals for a household with the shopping list and its cost, and cook from your cupboard.',jsonLd: homeJsonLd(config),styles: [showcase.STYLESHEET],body: html`${raw(hero)}@@@ -629,6 +630,7 @@ ${row.recipes.length ? html`<div class="recipe-grid">${row.recipes.map(recipeBlor.get('/updates', (req, res) => page(req, res, {index: true, cache: PUBLIC_CACHE,title: `What shipped on ${SITE_NAME}`,++ description: 'Every change deployed to OpenVibe.Food, newest first, from the OpenVibe network\'s shared update log.',body: raw(frame.updatesBody({ service: 'food', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`),}));@@@ -71,6 +71,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']);
@@ -103,6 +103,7 @@ ${res_.phone ? html`<p class="small">Phone: <a href="tel:${String(res_.phone).re
@@ -103,6 +103,7 @@ ${res_.phone ? html`<p class="small">Phone: <a href="tel:${String(res_.phone).re
});
});
page(req, res, {
page(req, res, {
index: true, cache: signedIn(req) ? null : PUBLIC_CACHE,
index: true, cache: signedIn(req) ? null : PUBLIC_CACHE,
+ description: 'Find food banks and budget grocers near you, plan meals for a household with the shopping list and its cost, and cook from your cupboard.',
jsonLd: homeJsonLd(config),
jsonLd: homeJsonLd(config),
styles: [showcase.STYLESHEET],
styles: [showcase.STYLESHEET],
body: html`${raw(hero)}
body: html`${raw(hero)}
@@ -629,6 +630,7 @@ ${row.recipes.length ? html`<div class="recipe-grid">${row.recipes.map(recipeBlo
@@ -629,6 +630,7 @@ ${row.recipes.length ? html`<div class="recipe-grid">${row.recipes.map(recipeBlo
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.Food, newest first, from the OpenVibe network\'s shared update log.',
body: raw(frame.updatesBody({ service: 'food', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`),
body: raw(frame.updatesBody({ service: 'food', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`),
}));
}));
@@ -71,6 +71,8 @@ const PRIVATE = ['/auth/', '/api/'];
@@ -71,6 +71,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']);