openvibers/openvibe.rent Commits

/in and /fair have Markdown twins; llms.txt links them (#212)

OP OpenVibers committed 10 days ago · ce8224a66d · 3 files, +13 −3

The cities (typical rents in 885 US cities) and the fair-rent check were listed in llms.txt as HTML pages with no
twin. They are on the same router the twinned pages render through; RENT_TWIN_PATH_RE names them now.

Changes

ddiff --git a/server/agent-pages.js b/server/agent-pages.js
iindex 003718e..6a0bc89 100644
---- a/server/agent-pages.js
++++ b/server/agent-pages.js
@@@ -6,7 +6,8 @@
// A twin is the page's own render: the host's page router answers the request in-process, signed out, so a twin
// cannot drift from the page a browser gets and never carries a signed-in person's view. A page behind a person
// (posting, a listing's edit form, the board, saved searches, the staff queue) or a missing listing has no twin.
--const RENT_TWIN_PATH_RE = /^\/(?:everywhere|housing|listings(?:\/[^/]+)?|safety|updates)?$/;
++// /in (the cities and a city's pages) and /fair (fair-housing rights) since 11-03: llms.txt listed them as HTML pages.
++const RENT_TWIN_PATH_RE = /^\/(?:everywhere|fair|housing|in(?:\/[^/]+(?:\/[^/]+)?)?|listings(?:\/[^/]+)?|safety|updates)?$/;
const HOMES_TWIN_PATH_RE = /^\/(?:search|records|mortgage|updates|in(?:\/[^/]+(?:\/[^/]+)?)?)?$/;
/** A request as an anonymous browser makes it: no session, no cookies. */
ddiff --git a/server/http/discovery.js b/server/http/discovery.js
iindex 6fb4f5a..791f631 100644
---- a/server/http/discovery.js
++++ b/server/http/discovery.js
@@@ -100,8 +100,8 @@ function createDiscoveryRoutes(ctx) {
{ title: 'Start here', links: [
{ title: 'OpenVibe.Rent', url: abs('/'), note: 'find something to rent, or offer your own' },
{ title: 'Search every rental site', url: abs('/everywhere'), note: 'one place and filters open Craigslist, Facebook Marketplace, Zillow, Apartments.com, Zumper and more at once' },
-- { title: 'Rent by city', url: abs('/in'), html: true, note: 'typical rents by size in 885 US cities (Census ACS), with every rental site\'s search for each city' },
-- { title: 'Is this rent fair?', url: abs('/fair'), html: true, note: 'a quoted monthly rent against the city\'s median for that size' },
++ { title: 'Rent by city', url: abs('/in'), note: 'typical rents by size in 885 US cities (Census ACS), with every rental site\'s search for each city' },
++ { title: 'Is this rent fair?', url: abs('/fair'), note: 'a quoted monthly rent against the city\'s median for that size' },
{ title: 'Affordable housing', url: abs('/housing'), note: 'public housing, LIHTC and HUD-assisted properties, and where to apply, near you' },
{ title: 'Listings', url: abs('/listings'), note: 'search by kind, city, country, price and period' },
{ title: 'Renting safely', url: abs('/safety'), note: 'the rules, including the one about deposits' },
ddiff --git a/test/discovery.test.js b/test/discovery.test.js
iindex 6fce90e..d4faea0 100644
---- a/test/discovery.test.js
++++ b/test/discovery.test.js
@@@ -53,6 +53,15 @@ const PRIVATE = ['/auth/', '/api/'];
assert.ok(r.text.startsWith('# OpenVibe.Rent'), 'no title');
assert.ok(r.text.includes('(https://openvibe.rent/index.md)'), 'home link points at its Markdown twin');
assert.ok(r.text.includes('(https://openvibe.rent/updates.md)'), 'no updates link');
++ // 11-03: the cities and the fair-rent check have twins too.
++ assert.ok(r.text.includes('(https://openvibe.rent/in.md)') && r.text.includes('(https://openvibe.rent/fair.md)'), 'cities and fair rent at their twins');
++ const { RENT_TWIN_PATH_RE } = require('../server/agent-pages');
++ assert.ok(['/in', '/in/ut', '/in/ut/salt-lake-city', '/fair'].every((p) => RENT_TWIN_PATH_RE.test(p)));
++ for (const p of ['/in.md', '/fair.md']) {
++ const twin = await t.get(p);
++ assert.strictEqual(twin.status, 200, p);
++ assert.match(twin.headers.get('content-type') || '', /^text\/markdown/, p);
++ }
assert.ok(r.text.includes('(https://openvibe.services)'), 'no pointer to the developer platform');
assert.ok(r.text.includes('https://openvibe.rent/sitemap.xml'), 'sitemap not listed');
assert.ok(r.text.includes('(https://openvibe.rent/llms-full.txt)'), 'llms-full.txt not listed');