openvibers/openvibe.events Commits
Events: the front page meets the edges, shows each curl sample whole, and lays the webhook steps two by two (#75)
Changes
@@@ -92,6 +92,11 @@ function sections({ apiUrl }) {});}++// The page's own few rules (it has no stylesheet beyond the showcase's): no browser margin around the body, so the Frame's++// footer meets the edges; each curl sample on its own full-width row (three columns cut every command off); the four++// webhook steps two by two instead of three and one alone, each title level with its number.++const HOME_STYLE = '<style>body{margin:0}.page .sc-code{grid-template-columns:minmax(0,1fr)}.page .sc-steps{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr))}.page .sc-steps li{align-items:start;align-content:start}.page .sc-steps b{line-height:30px}</style>';++function renderHome({ siteUrl, apiUrl }) {const nav = {service: 'events',@@@ -112,6 +117,7 @@ function renderHome({ siteUrl, apiUrl }) {head: [appIcon.headTags({ site: 'events' }),`<link rel="stylesheet" href="${ovServe.url(showcase.STYLESHEET)}">`,++ HOME_STYLE,].join('\n'),body: `<div id="navbar-mount"></div><main id="main" class="page">@@@ -73,6 +73,8 @@ t('GET / as a browser: the home page, its CSP and its cache policy', async () =>assert.strictEqual(r.headers['cache-control'], 'private, max-age=300');assert.strictEqual(r.headers.vary, 'Accept');assert.strictEqual((r.body.match(/<h1\b/g) || []).length, 1, 'exactly one h1');++ // The page's own rules: the body meets the edges (no browser margin), each curl sample takes a full row.++ assert.match(r.body, /<style>body\{margin:0\}\.page \.sc-code\{grid-template-columns:minmax\(0,1fr\)\}/);assert.ok(r.body.includes('Events your services'), 'the hero text');assert.ok(r.body.includes(`<link rel="canonical" href="${SITE}/">`), 'the canonical product origin');assert.ok(r.body.includes(`The API is at ${SITE}`), 'the hero note names the API origin');
@@ -92,6 +92,11 @@ function sections({ apiUrl }) {
@@ -92,6 +92,11 @@ function sections({ apiUrl }) {
});
});
}
}
+// The page's own few rules (it has no stylesheet beyond the showcase's): no browser margin around the body, so the Frame's
+// footer meets the edges; each curl sample on its own full-width row (three columns cut every command off); the four
+// webhook steps two by two instead of three and one alone, each title level with its number.
+const HOME_STYLE = '<style>body{margin:0}.page .sc-code{grid-template-columns:minmax(0,1fr)}.page .sc-steps{grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr))}.page .sc-steps li{align-items:start;align-content:start}.page .sc-steps b{line-height:30px}</style>';
+
function renderHome({ siteUrl, apiUrl }) {
function renderHome({ siteUrl, apiUrl }) {
const nav = {
const nav = {
service: 'events',
service: 'events',
@@ -112,6 +117,7 @@ function renderHome({ siteUrl, apiUrl }) {
@@ -112,6 +117,7 @@ function renderHome({ siteUrl, apiUrl }) {
head: [
head: [
appIcon.headTags({ site: 'events' }),
appIcon.headTags({ site: 'events' }),
`<link rel="stylesheet" href="${ovServe.url(showcase.STYLESHEET)}">`,
`<link rel="stylesheet" href="${ovServe.url(showcase.STYLESHEET)}">`,
+ HOME_STYLE,
].join('\n'),
].join('\n'),
body: `<div id="navbar-mount"></div>
body: `<div id="navbar-mount"></div>
<main id="main" class="page">
<main id="main" class="page">
@@ -73,6 +73,8 @@ t('GET / as a browser: the home page, its CSP and its cache policy', async () =>
@@ -73,6 +73,8 @@ t('GET / as a browser: the home page, its CSP and its cache policy', async () =>
assert.strictEqual(r.headers['cache-control'], 'private, max-age=300');
assert.strictEqual(r.headers['cache-control'], 'private, max-age=300');
assert.strictEqual(r.headers.vary, 'Accept');
assert.strictEqual(r.headers.vary, 'Accept');
assert.strictEqual((r.body.match(/<h1\b/g) || []).length, 1, 'exactly one h1');
assert.strictEqual((r.body.match(/<h1\b/g) || []).length, 1, 'exactly one h1');
+ // The page's own rules: the body meets the edges (no browser margin), each curl sample takes a full row.
+ assert.match(r.body, /<style>body\{margin:0\}\.page \.sc-code\{grid-template-columns:minmax\(0,1fr\)\}/);
assert.ok(r.body.includes('Events your services'), 'the hero text');
assert.ok(r.body.includes('Events your services'), 'the hero text');
assert.ok(r.body.includes(`<link rel="canonical" href="${SITE}/">`), 'the canonical product origin');
assert.ok(r.body.includes(`<link rel="canonical" href="${SITE}/">`), 'the canonical product origin');
assert.ok(r.body.includes(`The API is at ${SITE}`), 'the hero note names the API origin');
assert.ok(r.body.includes(`The API is at ${SITE}`), 'the hero note names the API origin');