openvibers/openvibe.chat Commits
Pages name a crawlable icon (apple-touch-icon) and the installable app's manifest, both the shared set (search engines cannot use the data: favicon; there was no manifest) (#117)
Changes
@@@ -11,6 +11,11 @@ const ovServe = require('openvibe-shared/serve');const sharedSeo = require('openvibe-shared/seo');const social = require('openvibe-shared/social');const appIcon = require('openvibe-shared/app-icon');++// A crawlable icon (search engines cannot use the data: favicon) and the installable app's manifest, both the shared set.++const INSTALL_LINKS = [++ `<link rel="apple-touch-icon" href="${require('openvibe-shared/app-icons').url('chat', 192)}">`,++ `<link rel="manifest" href="${ovServe.manifestUrl('chat')}">`,++].join('\n');const frame = require('openvibe-shared/frame');const SITE_NAME = 'OpenVibe.Chat';@@@ -114,6 +119,7 @@ function renderPage(o) {<meta name="viewport" content="width=device-width, initial-scale=1">${head}${appIcon.headTags({ site: 'network' })}++${INSTALL_LINKS}<link rel="stylesheet" href="${asset('chat.css')}"><link rel="stylesheet" href="${ovServe.url('items.css')}">${o.showcase ? `<link rel="stylesheet" href="${ovServe.url('showcase.css')}">` : ''}@@@ -176,6 +176,12 @@ t('sign-in, the Frame, robots, sitemap and /updates', async () => {const up = await req('GET', '/updates');assert.strictEqual(up.status, 200);assert.match(up.text, /data-ov-shipped/);++ // A crawlable icon and the installable app's manifest (the shared set, which this site serves).++ const icon = /<link rel="apple-touch-icon" href="(\/shared\/icons\/[^"]+)">/.exec(up.text);++ const manifest = /<link rel="manifest" href="(\/shared\/manifest\/chat\.webmanifest[^"]*)">/.exec(up.text);++ assert.ok(icon && manifest, 'apple-touch-icon and manifest links');++ assert.strictEqual((await req('GET', icon[1])).status, 200);++ assert.strictEqual((await req('GET', manifest[1])).status, 200);assert.strictEqual((await req('GET', '/api/nope')).status, 404, 'the API keeps its JSON 404');});
@@ -11,6 +11,11 @@ const ovServe = require('openvibe-shared/serve');
@@ -11,6 +11,11 @@ const ovServe = require('openvibe-shared/serve');
const sharedSeo = require('openvibe-shared/seo');
const sharedSeo = require('openvibe-shared/seo');
const social = require('openvibe-shared/social');
const social = require('openvibe-shared/social');
const appIcon = require('openvibe-shared/app-icon');
const appIcon = require('openvibe-shared/app-icon');
+// A crawlable icon (search engines cannot use the data: favicon) and the installable app's manifest, both the shared set.
+const INSTALL_LINKS = [
+ `<link rel="apple-touch-icon" href="${require('openvibe-shared/app-icons').url('chat', 192)}">`,
+ `<link rel="manifest" href="${ovServe.manifestUrl('chat')}">`,
+].join('\n');
const frame = require('openvibe-shared/frame');
const frame = require('openvibe-shared/frame');
const SITE_NAME = 'OpenVibe.Chat';
const SITE_NAME = 'OpenVibe.Chat';
@@ -114,6 +119,7 @@ function renderPage(o) {
@@ -114,6 +119,7 @@ function renderPage(o) {
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
${head}
${head}
${appIcon.headTags({ site: 'network' })}
${appIcon.headTags({ site: 'network' })}
+${INSTALL_LINKS}
<link rel="stylesheet" href="${asset('chat.css')}">
<link rel="stylesheet" href="${asset('chat.css')}">
<link rel="stylesheet" href="${ovServe.url('items.css')}">
<link rel="stylesheet" href="${ovServe.url('items.css')}">
${o.showcase ? `<link rel="stylesheet" href="${ovServe.url('showcase.css')}">` : ''}
${o.showcase ? `<link rel="stylesheet" href="${ovServe.url('showcase.css')}">` : ''}
@@ -176,6 +176,12 @@ t('sign-in, the Frame, robots, sitemap and /updates', async () => {
@@ -176,6 +176,12 @@ t('sign-in, the Frame, robots, sitemap and /updates', async () => {
const up = await req('GET', '/updates');
const up = await req('GET', '/updates');
assert.strictEqual(up.status, 200);
assert.strictEqual(up.status, 200);
assert.match(up.text, /data-ov-shipped/);
assert.match(up.text, /data-ov-shipped/);
+ // A crawlable icon and the installable app's manifest (the shared set, which this site serves).
+ const icon = /<link rel="apple-touch-icon" href="(\/shared\/icons\/[^"]+)">/.exec(up.text);
+ const manifest = /<link rel="manifest" href="(\/shared\/manifest\/chat\.webmanifest[^"]*)">/.exec(up.text);
+ assert.ok(icon && manifest, 'apple-touch-icon and manifest links');
+ assert.strictEqual((await req('GET', icon[1])).status, 200);
+ assert.strictEqual((await req('GET', manifest[1])).status, 200);
assert.strictEqual((await req('GET', '/api/nope')).status, 404, 'the API keeps its JSON 404');
assert.strictEqual((await req('GET', '/api/nope')).status, 404, 'the API keeps its JSON 404');
});
});