openvibers/openvibe.report Commits

/llms-full.txt (SEO-33): the site in full, from the same descriptor as llms.txt (#88)

OP OpenVibers committed 11 days ago · c786998859 · 2 files, +25 −2

It answered 404. The llms.txt descriptor becomes llmsSite(), and /llms-full.txt renders
it with seo.llmsFull: an About section (the summary and details), then every page
llms.txt lists with what it holds.

Changes

ddiff --git a/server/http/discovery.js b/server/http/discovery.js
iindex 4d98ee2..cc93db0 100644
---- a/server/http/discovery.js
++++ b/server/http/discovery.js
@@@ -68,8 +68,8 @@ function createDiscoveryRoutes({ config, live, bench }) {
res.type('application/xml').set('Cache-Control', CACHE).send(seo.sitemapXml(pages));
});
-- r.get('/llms.txt', (_req, res) => {
-- res.type('text/plain').set('Cache-Control', CACHE).send(seo.llmsTxt({
++ // The site as llms.txt describes it, shared by /llms.txt and /llms-full.txt (SEO-33).
++ const llmsSite = () => ({
name: SITE_NAME,
summary: 'Every number on OpenVibe, honest: the network\'s open stats, The Rundown of what streamers talked about, and every stream\'s after-show report.',
details: 'The numbers and the write-ups are read from OpenVibe.Network and OpenVibe.Live, cached in this process for a few minutes, and shown as the sources answer them. Nothing here is about a person.',
@@@ -94,6 +94,19 @@ function createDiscoveryRoutes({ config, live, bench }) {
{ title: 'OpenVibe.Live', url: 'https://openvibe.live', note: 'the streams, The Rundown and the after-show reports' },
] },
],
++ });
++ r.get('/llms.txt', (_req, res) => {
++ res.type('text/plain').set('Cache-Control', CACHE).send(seo.llmsTxt(llmsSite()));
++ });
++ // The same, in full (SEO-33): what the site is, then every page llms.txt lists with what it holds.
++ r.get('/llms-full.txt', (_req, res) => {
++ const d = llmsSite();
++ res.type('text/plain').set('Cache-Control', CACHE).send(seo.llmsFull({
++ site: d.name, summary: d.summary, base: abs('/'),
++ sections: [
++ { title: 'About', pages: [{ title: d.name, url: abs('/'), text: [d.summary, d.details].filter(Boolean).join('\n\n') }] },
++ ...(d.sections || []).map((x) => ({ title: x.title, pages: (x.links || []).map((l) => ({ title: l.title, url: l.url, text: l.note || '' })) })),
++ ],
}));
});
ddiff --git a/test/discovery.test.js b/test/discovery.test.js
iindex da66709..1a09e70 100644
---- a/test/discovery.test.js
++++ b/test/discovery.test.js
@@@ -55,6 +55,16 @@ const STATUS_UPDATED = JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'ST
]) assert.ok(r.text.includes(`(${link})`), `missing link ${link}`);
});
++ await check('llms-full.txt (SEO-33): the site in full, every page llms.txt lists with what it holds', async () => {
++ const r = await t.get('/llms-full.txt');
++ assert.strictEqual(r.status, 200);
++ assert.match(r.headers.get('content-type') || '', /^text\/plain/);
++ assert.ok(r.text.startsWith('# OpenVibe.Report'));
++ assert.ok(r.text.length > 500, `${r.text.length} characters`);
++ assert.match(r.text, /## About\n\n### OpenVibe\.Report\n\nURL: https:\/\/openvibe\.report\/\n\nEvery number on OpenVibe, honest/);
++ assert.match(r.text, /### Design health\n\nURL: https:\/\/openvibe\.report\/design\n\nhow closely each site follows/);
++ });
++
await check('a topics source that answers nothing still leaves the three static sitemap pages', async () => {
const empty = await boot({ data: { topics: null } });
try {