openvibers/openrestream Commits
/llms-full.txt (SEO-33): the site in full (#198)
Changes
@@@ -30,8 +30,8 @@ function createDiscoveryRoutes({ config, releaseLastmod }) {router.get('/sitemap.xml', (_req, res) => res.type('application/xml').set('Cache-Control', cache.htmlHeaders()).send(seo.sitemapXml(PUBLIC_PATHS.map((loc) => ({ loc: abs(loc), lastmod: releaseLastmod })))));-- router.get('/llms.txt', (_req, res) => res.type('text/plain').set('Cache-Control', cache.htmlHeaders()).send(-- seo.llmsTxt({++ // The site as llms.txt describes it, shared by /llms.txt and /llms-full.txt (SEO-33).++ const llmsSite = () => ({name: 'OpenRestream',summary: 'OpenRestream (openre.stream) is an open restreaming platform: send one stream from OBS or any RTMP encoder and it goes to Twitch, YouTube, Kick and any RTMP, RTMPS or SRT server at the same time, with the person\'s OpenVibe Live channel on by default. It is free and open source, with no follower minimum. With no OBS, people go live from their browser on OpenVibe.Live (openvibe.live, the Go Live button).',details: [@@@ -59,7 +59,20 @@ function createDiscoveryRoutes({ config, releaseLastmod }) {{ title: 'robots.txt', url: abs('/robots.txt') },] },],-- })));++ });++ router.get('/llms.txt', (_req, res) => res.type('text/plain').set('Cache-Control', cache.htmlHeaders()).send(++ seo.llmsTxt(llmsSite())));++ // The same, in full (SEO-33): what the site is, then every page llms.txt lists with what it holds.++ router.get('/llms-full.txt', (_req, res) => {++ const d = llmsSite();++ res.type('text/plain').set('Cache-Control', cache.htmlHeaders()).send(seo.llmsFull({++ site: d.name, summary: d.summary, base: abs('/'),++ sections: [++ { title: 'About', pages: [{ title: d.name, url: abs('/'), text: [d.summary, Array.isArray(d.details) ? d.details.join('\n') : 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 || '' })) })),++ ],++ }));++ });return router;}@@@ -67,6 +67,21 @@ t('llms.txt is plain text, leads with open restreaming (OpenVibe Live on by defa}});++t('llms-full.txt (SEO-33): the site in full, from the same descriptor as llms.txt', async () => {++ const api = await bootApi({});++ try {++ const r = await request(api.base, 'GET', '/llms-full.txt');++ assert.strictEqual(r.status, 200);++ assert.match(r.headers.get('content-type'), /^text\/plain/);++ assert.ok(r.text.startsWith('# OpenRestream\n'));++ assert.ok(r.text.length > 500, `${r.text.length} characters`);++ assert.match(r.text, /## About\n\n### OpenRestream\n/);++ assert.match(r.text, /OpenRestream is also the ingest and restream engine of the OpenVibe network/, 'the details, joined as lines');++ } finally {++ await api.close();++ }++});++t('the front page leads with open restreaming, links to Live for browser go-live, and says what runs here', async () => {const api = await bootApi({ env: { BASE_URL: 'https://openre.stream' } });try {
@@ -30,8 +30,8 @@ function createDiscoveryRoutes({ config, releaseLastmod }) {
@@ -30,8 +30,8 @@ function createDiscoveryRoutes({ config, releaseLastmod }) {
router.get('/sitemap.xml', (_req, res) => res.type('application/xml').set('Cache-Control', cache.htmlHeaders()).send(
router.get('/sitemap.xml', (_req, res) => res.type('application/xml').set('Cache-Control', cache.htmlHeaders()).send(
seo.sitemapXml(PUBLIC_PATHS.map((loc) => ({ loc: abs(loc), lastmod: releaseLastmod })))));
seo.sitemapXml(PUBLIC_PATHS.map((loc) => ({ loc: abs(loc), lastmod: releaseLastmod })))));
- router.get('/llms.txt', (_req, res) => res.type('text/plain').set('Cache-Control', cache.htmlHeaders()).send(
- seo.llmsTxt({
+ // The site as llms.txt describes it, shared by /llms.txt and /llms-full.txt (SEO-33).
+ const llmsSite = () => ({
name: 'OpenRestream',
name: 'OpenRestream',
summary: 'OpenRestream (openre.stream) is an open restreaming platform: send one stream from OBS or any RTMP encoder and it goes to Twitch, YouTube, Kick and any RTMP, RTMPS or SRT server at the same time, with the person\'s OpenVibe Live channel on by default. It is free and open source, with no follower minimum. With no OBS, people go live from their browser on OpenVibe.Live (openvibe.live, the Go Live button).',
summary: 'OpenRestream (openre.stream) is an open restreaming platform: send one stream from OBS or any RTMP encoder and it goes to Twitch, YouTube, Kick and any RTMP, RTMPS or SRT server at the same time, with the person\'s OpenVibe Live channel on by default. It is free and open source, with no follower minimum. With no OBS, people go live from their browser on OpenVibe.Live (openvibe.live, the Go Live button).',
details: [
details: [
@@ -59,7 +59,20 @@ function createDiscoveryRoutes({ config, releaseLastmod }) {
@@ -59,7 +59,20 @@ function createDiscoveryRoutes({ config, releaseLastmod }) {
{ title: 'robots.txt', url: abs('/robots.txt') },
{ title: 'robots.txt', url: abs('/robots.txt') },
] },
] },
],
],
- })));
+ });
+ router.get('/llms.txt', (_req, res) => res.type('text/plain').set('Cache-Control', cache.htmlHeaders()).send(
+ seo.llmsTxt(llmsSite())));
+ // The same, in full (SEO-33): what the site is, then every page llms.txt lists with what it holds.
+ router.get('/llms-full.txt', (_req, res) => {
+ const d = llmsSite();
+ res.type('text/plain').set('Cache-Control', cache.htmlHeaders()).send(seo.llmsFull({
+ site: d.name, summary: d.summary, base: abs('/'),
+ sections: [
+ { title: 'About', pages: [{ title: d.name, url: abs('/'), text: [d.summary, Array.isArray(d.details) ? d.details.join('\n') : 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 || '' })) })),
+ ],
+ }));
+ });
return router;
return router;
}
}
@@ -67,6 +67,21 @@ t('llms.txt is plain text, leads with open restreaming (OpenVibe Live on by defa
@@ -67,6 +67,21 @@ t('llms.txt is plain text, leads with open restreaming (OpenVibe Live on by defa
}
}
});
});
+t('llms-full.txt (SEO-33): the site in full, from the same descriptor as llms.txt', async () => {
+ const api = await bootApi({});
+ try {
+ const r = await request(api.base, 'GET', '/llms-full.txt');
+ assert.strictEqual(r.status, 200);
+ assert.match(r.headers.get('content-type'), /^text\/plain/);
+ assert.ok(r.text.startsWith('# OpenRestream\n'));
+ assert.ok(r.text.length > 500, `${r.text.length} characters`);
+ assert.match(r.text, /## About\n\n### OpenRestream\n/);
+ assert.match(r.text, /OpenRestream is also the ingest and restream engine of the OpenVibe network/, 'the details, joined as lines');
+ } finally {
+ await api.close();
+ }
+});
+
t('the front page leads with open restreaming, links to Live for browser go-live, and says what runs here', async () => {
t('the front page leads with open restreaming, links to Live for browser go-live, and says what runs here', async () => {
const api = await bootApi({ env: { BASE_URL: 'https://openre.stream' } });
const api = await bootApi({ env: { BASE_URL: 'https://openre.stream' } });
try {
try {