openvibers/openvibe.space Commits
OpenVibe.Space has its own update log at /updates (it sent readers to the community's log, which lists the community's changes); the navbar and footer link it (#71)
Changes
@@@ -139,8 +139,14 @@ async function createApp(opts = {}) {app.use('/auth', createAuthRoutes(config, auth));{ const legal = require('openvibe-shared/legal'); app.get(legal.PATHS, legal.handler({ id: 'space', service: 'space', host: 'openvibe.space', name: 'OpenVibe.Space', profile: 'ugc' })); app.get('/tos', (_req, res) => res.redirect(301, '/terms')); }-- // /updates: Space ships with the community's log until it has one of its own.-- app.get('/updates', (_req, res) => res.redirect(302, `${config.communityUrl}/updates`));++ // /updates: what shipped on OpenVibe.Space, the shared update log every OpenVibe site has (it pointed at the++ // community's log, which lists the community's changes, not this site's).++ app.get('/updates', (req, res) => {++ const { renderPage } = require('./render/layout');++ const frame = require('openvibe-shared/frame');++ const body = frame.updatesBody({ service: 'space', siteName: 'OpenVibe.Space' }) + `<script src="${require('openvibe-shared/serve').url('shipped.js')}" defer></script>`;++ res.type('html').send(renderPage({ title: 'What shipped on OpenVibe.Space', description: 'Every change deployed to OpenVibe.Space, newest first, from the OpenVibe network\'s shared update log.', canonicalPath: '/updates', body, viewer: req.viewer, config, path: req.originalUrl, indexable: true }));++ });app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openvibe-space', version: VERSION }));// GET /release.json (ADR-016) and POST /release-metrics: open tabs' update reports (a same-origin@@@ -87,7 +87,7 @@ function footerInit(opts) {variant: opts.footerVariant || 'full',mount: '#ov-footer',brandName: SITE_NAME,-- updates: `${config.communityUrl}/updates`, // this site ships with the community's log for now++ updates: '/updates',tagline: 'Static hosting for the people of OpenVibe.',legalBase: config.liveUrl,links: [{@@@ -130,7 +130,7 @@ function renderPage(o) {jsonLd: o.jsonLd, alternates: o.alternates,summary: description, url: canonical, updated: o.modified,navbar: nav, home: '/', navLinks: nav.links.map(({ label, href }) => ({ label, href })),-- footer: { service: 'space', variant: 'full', updates: `${config.communityUrl}/updates` },++ footer: { service: 'space', variant: 'full', updates: '/updates' },head: [o.published ? `<meta property="article:published_time" content="${escapeHtml(o.published)}">` : '',o.modified ? `<meta property="article:modified_time" content="${escapeHtml(o.modified)}">` : '',@@@ -37,6 +37,15 @@ const { boot, check, done } = require('./helpers/app');assert.doesNotMatch(r.text, /href="\/s"/, 'nothing links a /s that only redirects');});++ await check('/updates is this site\'s own update log, and the footer links it', async () => {++ const r = await t.get('/updates');++ assert.strictEqual(r.status, 200);++ assert.ok(r.text.includes('What shipped on OpenVibe.Space'));++ assert.ok(r.text.includes('data-ov-shipped') && r.text.includes('data-service="space"'), 'the shared log, for space');++ const home = await t.get('/');++ assert.ok(!home.text.includes('openvibe.community/updates'), 'the footer no longer sends readers to the community\'s log');++ });++await check('robots.txt points at the sitemap and keeps the private paths out', async () => {const r = await t.get('/robots.txt');assert.strictEqual(r.status, 200);
@@ -139,8 +139,14 @@ async function createApp(opts = {}) {
@@ -139,8 +139,14 @@ async function createApp(opts = {}) {
app.use('/auth', createAuthRoutes(config, auth));
app.use('/auth', createAuthRoutes(config, auth));
{ const legal = require('openvibe-shared/legal'); app.get(legal.PATHS, legal.handler({ id: 'space', service: 'space', host: 'openvibe.space', name: 'OpenVibe.Space', profile: 'ugc' })); app.get('/tos', (_req, res) => res.redirect(301, '/terms')); }
{ const legal = require('openvibe-shared/legal'); app.get(legal.PATHS, legal.handler({ id: 'space', service: 'space', host: 'openvibe.space', name: 'OpenVibe.Space', profile: 'ugc' })); app.get('/tos', (_req, res) => res.redirect(301, '/terms')); }
- // /updates: Space ships with the community's log until it has one of its own.
- app.get('/updates', (_req, res) => res.redirect(302, `${config.communityUrl}/updates`));
+ // /updates: what shipped on OpenVibe.Space, the shared update log every OpenVibe site has (it pointed at the
+ // community's log, which lists the community's changes, not this site's).
+ app.get('/updates', (req, res) => {
+ const { renderPage } = require('./render/layout');
+ const frame = require('openvibe-shared/frame');
+ const body = frame.updatesBody({ service: 'space', siteName: 'OpenVibe.Space' }) + `<script src="${require('openvibe-shared/serve').url('shipped.js')}" defer></script>`;
+ res.type('html').send(renderPage({ title: 'What shipped on OpenVibe.Space', description: 'Every change deployed to OpenVibe.Space, newest first, from the OpenVibe network\'s shared update log.', canonicalPath: '/updates', body, viewer: req.viewer, config, path: req.originalUrl, indexable: true }));
+ });
app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openvibe-space', version: VERSION }));
app.get('/api/health', (_req, res) => res.json({ status: 'ok', service: 'openvibe-space', version: VERSION }));
// GET /release.json (ADR-016) and POST /release-metrics: open tabs' update reports (a same-origin
// GET /release.json (ADR-016) and POST /release-metrics: open tabs' update reports (a same-origin
@@ -87,7 +87,7 @@ function footerInit(opts) {
@@ -87,7 +87,7 @@ function footerInit(opts) {
variant: opts.footerVariant || 'full',
variant: opts.footerVariant || 'full',
mount: '#ov-footer',
mount: '#ov-footer',
brandName: SITE_NAME,
brandName: SITE_NAME,
- updates: `${config.communityUrl}/updates`, // this site ships with the community's log for now
+ updates: '/updates',
tagline: 'Static hosting for the people of OpenVibe.',
tagline: 'Static hosting for the people of OpenVibe.',
legalBase: config.liveUrl,
legalBase: config.liveUrl,
links: [{
links: [{
@@ -130,7 +130,7 @@ function renderPage(o) {
@@ -130,7 +130,7 @@ function renderPage(o) {
jsonLd: o.jsonLd, alternates: o.alternates,
jsonLd: o.jsonLd, alternates: o.alternates,
summary: description, url: canonical, updated: o.modified,
summary: description, url: canonical, updated: o.modified,
navbar: nav, home: '/', navLinks: nav.links.map(({ label, href }) => ({ label, href })),
navbar: nav, home: '/', navLinks: nav.links.map(({ label, href }) => ({ label, href })),
- footer: { service: 'space', variant: 'full', updates: `${config.communityUrl}/updates` },
+ footer: { service: 'space', variant: 'full', updates: '/updates' },
head: [
head: [
o.published ? `<meta property="article:published_time" content="${escapeHtml(o.published)}">` : '',
o.published ? `<meta property="article:published_time" content="${escapeHtml(o.published)}">` : '',
o.modified ? `<meta property="article:modified_time" content="${escapeHtml(o.modified)}">` : '',
o.modified ? `<meta property="article:modified_time" content="${escapeHtml(o.modified)}">` : '',
@@ -37,6 +37,15 @@ const { boot, check, done } = require('./helpers/app');
@@ -37,6 +37,15 @@ const { boot, check, done } = require('./helpers/app');
assert.doesNotMatch(r.text, /href="\/s"/, 'nothing links a /s that only redirects');
assert.doesNotMatch(r.text, /href="\/s"/, 'nothing links a /s that only redirects');
});
});
+ await check('/updates is this site\'s own update log, and the footer links it', async () => {
+ const r = await t.get('/updates');
+ assert.strictEqual(r.status, 200);
+ assert.ok(r.text.includes('What shipped on OpenVibe.Space'));
+ assert.ok(r.text.includes('data-ov-shipped') && r.text.includes('data-service="space"'), 'the shared log, for space');
+ const home = await t.get('/');
+ assert.ok(!home.text.includes('openvibe.community/updates'), 'the footer no longer sends readers to the community\'s log');
+ });
+
await check('robots.txt points at the sitemap and keeps the private paths out', async () => {
await check('robots.txt points at the sitemap and keeps the private paths out', async () => {
const r = await t.get('/robots.txt');
const r = await t.get('/robots.txt');
assert.strictEqual(r.status, 200);
assert.strictEqual(r.status, 200);