openvibers/openrestream Commits

Pages name a crawlable icon (apple-touch-icon) and the installable app's manifest, both the shared set (only the data: favicon before, no manifest) (#87)

OP OpenVibers committed 27 days ago · 91ec48880e · 2 files, +7 −0

Changes

ddiff --git a/server/ui/layout.js b/server/ui/layout.js
iindex b6f16e1..b43d65d 100644
---- a/server/ui/layout.js
++++ b/server/ui/layout.js
@@@ -79,6 +79,10 @@ function renderPage({ title, body, user, canonicalPath = '/', robots = 'noindex,
try { footerSsr = require('openvibe-shared/footer').ssr({ service: 'openre', variant: 'compact', updates: '/updates' }); } catch { footerSsr = '<footer id="ov-footer"></footer>'; }
let icon = '';
try { icon = require('openvibe-shared/app-icon').headTags({ site: 'network' }); } catch { icon = ''; }
++ // A crawlable icon (search engines cannot use the data: favicon) and the installable app's manifest: the shared set.
++ try {
++ icon += `\n<link rel="apple-touch-icon" href="${require('openvibe-shared/app-icons').url('openre', 192)}">\n<link rel="manifest" href="${ovServe.manifestUrl('openre')}">`;
++ } catch { /* the inline favicon is enough to render */ }
return `<!DOCTYPE html>
<html lang="en">
<head>
ddiff --git a/test/discovery.test.js b/test/discovery.test.js
iindex 1d00198..539c841 100644
---- a/test/discovery.test.js
++++ b/test/discovery.test.js
@@@ -79,6 +79,9 @@ t('the front page leads with open restreaming, links to Live for browser go-live
assert.ok(r.text.includes(`href="${api.config.liveUrl}"`), 'browser go-live opens OpenVibe.Live, where it runs today');
assert.match(r.text, /Going live from a browser happens on OpenVibe\.Live for now/);
assert.match(r.text, /href="\/shared\/showcase\.css\?v=[0-9a-f]{12}"/);
++ // A crawlable icon and the installable app's manifest (the shared set): search engines cannot use the data: favicon.
++ assert.match(r.text, /<link rel="apple-touch-icon" href="\/shared\/icons\/[a-z0-9-]+-192\.png\?v=[0-9a-f]{12}">/);
++ assert.match(r.text, /<link rel="manifest" href="\/shared\/manifest\/openre\.webmanifest\?v=[0-9a-f]{12}">/);
// The showcase sits in main.ore's column, which has its gutter already: no second one, so the sign-in line and
// "Recently shipped" line up with the sections above.
assert.ok(r.text.includes('main.ore .sc-hero,main.ore .sc-sec,main.ore .sc-cta{padding-left:0;padding-right:0}'));