openvibers/openvibe.markets Commits
llms-full.txt: the home page as words (#20)
Changes
@@@ -55,7 +55,18 @@ function createApp({ deals, vision = null, now = () => Date.now(), photoLimits =app.get('/llms.txt', (_req, res) => res.type('text').send(['# OpenVibe.Markets', '', '> Every marketplace, one search: OpenVibe Deals\' offers (each price as of its time) and the big marketplaces opened with the search filled in.', '','- Search: https://openvibe.markets/search?q=<words>', '- API: GET https://openvibe.markets/api/v1/search?q=<words> → { q, deals: { ok, total, results }, elsewhere: [{ name, kind, url }] }', '',++ '## Optional', '', '- [Full text (llms-full.txt)](https://openvibe.markets/llms-full.txt): the home page as words', '',].join('\n')));++ // The full text for language models (SEO-33): the home page as Markdown from its own render (11-28: /llms-full.txt++ // was a 404 to agents, tools/llms-check.js).++ app.get('/llms-full.txt', (_req, res) => {++ const words = require('openvibe-shared/agent-layer').markdownTwin({ html: v.home({ photo: Boolean(vision && vision.ready) }), canonical: 'https://openvibe.markets/' }).replace(/^---[\s\S]*?\n---\n/, '').trim();++ res.type('text').set('Cache-Control', 'public, max-age=3600').send(seo.llmsFull({++ site: { name: 'OpenVibe.Markets', url: 'https://openvibe.markets' },++ summary: 'Every marketplace, one search: OpenVibe Deals\' offers (each price as of its time) and the big marketplaces opened with the search filled in.',++ sections: [{ title: 'OpenVibe.Markets', url: '/', body: words }],++ }));++ });app.use(express.static(path.join(__dirname, '..', 'public'), { maxAge: '1h' }));app.use('/shared', require('openvibe-shared/serve').handler());@@@ -95,6 +95,11 @@ const OFFERS = [assert.ok(!/Disallow: \/search/.test(r.text) && /Sitemap: https:\/\/openvibe\.markets\/sitemap\.xml/.test(r.text), r.text);assert.match((await get('/sitemap.xml')).text, /<loc>https:\/\/openvibe\.markets\/<\/loc>/);assert.match((await get('/llms.txt')).text, /OpenVibe\.Markets/);++ // llms-full.txt (11-28: a 404 to agents): the home page as words, linked from llms.txt.++ const full = await get('/llms-full.txt');++ assert.strictEqual(full.status, 200);++ assert.ok(full.text.startsWith('# OpenVibe.Markets') && full.text.length > 300 && !/<(?:script|style)\b/i.test(full.text), 'words, not markup');++ assert.match((await get('/llms.txt')).text, /\(https:\/\/openvibe\.markets\/llms-full\.txt\)/);assert.strictEqual((await get('/nope')).status, 404);// Deals unreachable: said plainly, the links still work.
@@ -55,7 +55,18 @@ function createApp({ deals, vision = null, now = () => Date.now(), photoLimits =
@@ -55,7 +55,18 @@ function createApp({ deals, vision = null, now = () => Date.now(), photoLimits =
app.get('/llms.txt', (_req, res) => res.type('text').send([
app.get('/llms.txt', (_req, res) => res.type('text').send([
'# OpenVibe.Markets', '', '> Every marketplace, one search: OpenVibe Deals\' offers (each price as of its time) and the big marketplaces opened with the search filled in.', '',
'# OpenVibe.Markets', '', '> Every marketplace, one search: OpenVibe Deals\' offers (each price as of its time) and the big marketplaces opened with the search filled in.', '',
'- Search: https://openvibe.markets/search?q=<words>', '- API: GET https://openvibe.markets/api/v1/search?q=<words> → { q, deals: { ok, total, results }, elsewhere: [{ name, kind, url }] }', '',
'- Search: https://openvibe.markets/search?q=<words>', '- API: GET https://openvibe.markets/api/v1/search?q=<words> → { q, deals: { ok, total, results }, elsewhere: [{ name, kind, url }] }', '',
+ '## Optional', '', '- [Full text (llms-full.txt)](https://openvibe.markets/llms-full.txt): the home page as words', '',
].join('\n')));
].join('\n')));
+ // The full text for language models (SEO-33): the home page as Markdown from its own render (11-28: /llms-full.txt
+ // was a 404 to agents, tools/llms-check.js).
+ app.get('/llms-full.txt', (_req, res) => {
+ const words = require('openvibe-shared/agent-layer').markdownTwin({ html: v.home({ photo: Boolean(vision && vision.ready) }), canonical: 'https://openvibe.markets/' }).replace(/^---[\s\S]*?\n---\n/, '').trim();
+ res.type('text').set('Cache-Control', 'public, max-age=3600').send(seo.llmsFull({
+ site: { name: 'OpenVibe.Markets', url: 'https://openvibe.markets' },
+ summary: 'Every marketplace, one search: OpenVibe Deals\' offers (each price as of its time) and the big marketplaces opened with the search filled in.',
+ sections: [{ title: 'OpenVibe.Markets', url: '/', body: words }],
+ }));
+ });
app.use(express.static(path.join(__dirname, '..', 'public'), { maxAge: '1h' }));
app.use(express.static(path.join(__dirname, '..', 'public'), { maxAge: '1h' }));
app.use('/shared', require('openvibe-shared/serve').handler());
app.use('/shared', require('openvibe-shared/serve').handler());
@@ -95,6 +95,11 @@ const OFFERS = [
@@ -95,6 +95,11 @@ const OFFERS = [
assert.ok(!/Disallow: \/search/.test(r.text) && /Sitemap: https:\/\/openvibe\.markets\/sitemap\.xml/.test(r.text), r.text);
assert.ok(!/Disallow: \/search/.test(r.text) && /Sitemap: https:\/\/openvibe\.markets\/sitemap\.xml/.test(r.text), r.text);
assert.match((await get('/sitemap.xml')).text, /<loc>https:\/\/openvibe\.markets\/<\/loc>/);
assert.match((await get('/sitemap.xml')).text, /<loc>https:\/\/openvibe\.markets\/<\/loc>/);
assert.match((await get('/llms.txt')).text, /OpenVibe\.Markets/);
assert.match((await get('/llms.txt')).text, /OpenVibe\.Markets/);
+ // llms-full.txt (11-28: a 404 to agents): the home page as words, linked from llms.txt.
+ const full = await get('/llms-full.txt');
+ assert.strictEqual(full.status, 200);
+ assert.ok(full.text.startsWith('# OpenVibe.Markets') && full.text.length > 300 && !/<(?:script|style)\b/i.test(full.text), 'words, not markup');
+ assert.match((await get('/llms.txt')).text, /\(https:\/\/openvibe\.markets\/llms-full\.txt\)/);
assert.strictEqual((await get('/nope')).status, 404);
assert.strictEqual((await get('/nope')).status, 404);
// Deals unreachable: said plainly, the links still work.
// Deals unreachable: said plainly, the links still work.