openvibers/openvibe.rent Commits

Rent: the home page's meta description says what the site does (#43)

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

The home page's meta description was the layout's fallback, "OpenVibe.Rent — <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 d42efb7..dfcaa4b 100644
---- a/server/http/pages.js
++++ b/server/http/pages.js
@@@ -164,6 +164,7 @@ ${notice(p && p.detail ? p.detail : 'You are over the limit for this.', 'warn')}
});
page(req, res, {
index: true, cache: signedIn(req) ? null : PUBLIC_CACHE,
++ description: 'Find somewhere to live, work or park, posted by people, and affordable housing near you from U.S. HUD open data. No payments, no scraping.',
jsonLd: homeJsonLd(config),
styles: [showcase.STYLESHEET],
body: html`${raw(hero)}
@@@ -870,6 +871,7 @@ ${notice(listings.SAFETY, 'warn')}
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.Rent, newest first, from the OpenVibe network\'s shared update log.',
body: raw(frame.updatesBody({ service: 'rent', siteName: SITE_NAME }) + `<script src="${ovServe.url('shipped.js')}" defer></script>`),
}));
ddiff --git a/test/discovery.test.js b/test/discovery.test.js
iindex 50a026d..43239c6 100644
---- a/test/discovery.test.js
++++ b/test/discovery.test.js
@@@ -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']);