openvibers/openvibe.shared Commits
Shared 4.0.1: the share card follows the navbar or footer service (#63)
Changes
@@@ -4,6 +4,16 @@ All notable changes to `openvibe-shared`. Versions follow [semver](https://semvebreaking change to any exported module, browser global or served file name is a new major.A release is the git tag `vX.Y.Z`; consumers pin the tag's tarball (see README).++## 4.0.2 — 2026-10-11++++- `shell.page()` finds the site's share card from `navbar.service` or `footer.service` when the page itself names no++ `service` (most sites set it only there), so their pages get `og:image` too.++- The site template pins openvibe-shared v4.0.0 (it still named v3.0.0).++++## 4.0.1 — 2026-10-11++++- Tagged in error on the 4.0.0 commit: identical to 4.0.0. Use 4.0.2.++## 4.0.0 — 2026-10-11- **Share cards for every site** (`openvibe-shared/social`, new): a 1200×630 card per service in@@@ -4,7 +4,7 @@"code": true,"wave": "W2","package": "openvibe-shared",-- "version": "4.0.0",++ "version": "4.0.2","plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026)","deployed": false,"deployment": "none of its own: a package released as git tags; OpenVibe.Network serves /shared/* from its pinned tag, and a site can serve its own pinned copy (openvibe-shared/serve)",@@@ -1,6 +1,6 @@{"name": "openvibe-shared",-- "version": "4.0.0",++ "version": "4.0.2","description": "Shared navbar, footer, themes, icons, legal pages, SEO, auth and analytics for every OpenVibe site","main": "index.js","bin": {@@@ -85,9 +85,13 @@ function scripts(o = {}) {* navbar, features, routes, versions the runtime boot (see `scripts`)*/// A page that names no image shares its site's card (openvibe-shared/social), when the site has one and the page--// has a canonical URL to make it absolute against; `image: null` opts out.++// has a canonical URL to make it absolute against; the service is the page's, else its navbar's or footer's.++// `image: null` opts out.function defaultImage(o) {-- return o.canonical ? social.url(o.service) : null;++ if (!o.canonical) return null;++ // Most sites name their service on the navbar and footer configs rather than on the page itself.++ const service = o.service || (o.navbar && o.navbar.service) || (o.footer && o.footer.service);++ return service ? social.url(service) : null;}function page(o = {}) {@@@ -9,6 +9,6 @@},"dependencies": {"express": "^4.22.3",-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v3.0.0"++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.0.0"}}@@@ -81,5 +81,7 @@ function jpegSize(buf) {assert.ok(!/og:image/.test(shell.page({ service: 'news', canonical: 'https://openvibe.news/', image: null })));assert.ok(!/og:image/.test(shell.page({ service: 'news' })), 'no canonical, no relative og:image');assert.ok(!/og:image/.test(shell.page({ service: 'no-such-site', canonical: 'https://x.example/' })));++ assert.match(shell.page({ name: 'OpenVibe.Watch', canonical: 'https://openvibe.watch/', navbar: { service: 'watch' } }), /og:image" content="https:\/\/openvibe\.watch\/shared\/social\/watch\.jpg\?v=/, 'the navbar names the service');++ assert.match(shell.page({ name: 'OpenVibe.Food', canonical: 'https://openvibe.food/', footer: { service: 'food' } }), /social\/food\.jpg/, 'or the footer does');console.log('social: ok');})().catch((e) => { console.error(e); process.exit(1); });
@@ -4,6 +4,16 @@ All notable changes to `openvibe-shared`. Versions follow [semver](https://semve
@@ -4,6 +4,16 @@ All notable changes to `openvibe-shared`. Versions follow [semver](https://semve
breaking change to any exported module, browser global or served file name is a new major.
breaking change to any exported module, browser global or served file name is a new major.
A release is the git tag `vX.Y.Z`; consumers pin the tag's tarball (see README).
A release is the git tag `vX.Y.Z`; consumers pin the tag's tarball (see README).
+## 4.0.2 — 2026-10-11
+
+- `shell.page()` finds the site's share card from `navbar.service` or `footer.service` when the page itself names no
+ `service` (most sites set it only there), so their pages get `og:image` too.
+- The site template pins openvibe-shared v4.0.0 (it still named v3.0.0).
+
+## 4.0.1 — 2026-10-11
+
+- Tagged in error on the 4.0.0 commit: identical to 4.0.0. Use 4.0.2.
+
## 4.0.0 — 2026-10-11
## 4.0.0 — 2026-10-11
- **Share cards for every site** (`openvibe-shared/social`, new): a 1200×630 card per service in
- **Share cards for every site** (`openvibe-shared/social`, new): a 1200×630 card per service in
@@ -4,7 +4,7 @@
@@ -4,7 +4,7 @@
"code": true,
"code": true,
"wave": "W2",
"wave": "W2",
"package": "openvibe-shared",
"package": "openvibe-shared",
- "version": "4.0.0",
+ "version": "4.0.2",
"plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026)",
"plan": "OpenVibe End-to-End Realignment & Implementation Plan, revision 3 (20 Sep 2026)",
"deployed": false,
"deployed": false,
"deployment": "none of its own: a package released as git tags; OpenVibe.Network serves /shared/* from its pinned tag, and a site can serve its own pinned copy (openvibe-shared/serve)",
"deployment": "none of its own: a package released as git tags; OpenVibe.Network serves /shared/* from its pinned tag, and a site can serve its own pinned copy (openvibe-shared/serve)",
@@ -1,6 +1,6 @@
@@ -1,6 +1,6 @@
{
{
"name": "openvibe-shared",
"name": "openvibe-shared",
- "version": "4.0.0",
+ "version": "4.0.2",
"description": "Shared navbar, footer, themes, icons, legal pages, SEO, auth and analytics for every OpenVibe site",
"description": "Shared navbar, footer, themes, icons, legal pages, SEO, auth and analytics for every OpenVibe site",
"main": "index.js",
"main": "index.js",
"bin": {
"bin": {
@@ -85,9 +85,13 @@ function scripts(o = {}) {
@@ -85,9 +85,13 @@ function scripts(o = {}) {
* navbar, features, routes, versions the runtime boot (see `scripts`)
* navbar, features, routes, versions the runtime boot (see `scripts`)
*/
*/
// A page that names no image shares its site's card (openvibe-shared/social), when the site has one and the page
// A page that names no image shares its site's card (openvibe-shared/social), when the site has one and the page
-// has a canonical URL to make it absolute against; `image: null` opts out.
+// has a canonical URL to make it absolute against; the service is the page's, else its navbar's or footer's.
+// `image: null` opts out.
function defaultImage(o) {
function defaultImage(o) {
- return o.canonical ? social.url(o.service) : null;
+ if (!o.canonical) return null;
+ // Most sites name their service on the navbar and footer configs rather than on the page itself.
+ const service = o.service || (o.navbar && o.navbar.service) || (o.footer && o.footer.service);
+ return service ? social.url(service) : null;
}
}
function page(o = {}) {
function page(o = {}) {
@@ -9,6 +9,6 @@
@@ -9,6 +9,6 @@
},
},
"dependencies": {
"dependencies": {
"express": "^4.22.3",
"express": "^4.22.3",
- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v3.0.0"
+ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v4.0.0"
}
}
}
}
@@ -81,5 +81,7 @@ function jpegSize(buf) {
@@ -81,5 +81,7 @@ function jpegSize(buf) {
assert.ok(!/og:image/.test(shell.page({ service: 'news', canonical: 'https://openvibe.news/', image: null })));
assert.ok(!/og:image/.test(shell.page({ service: 'news', canonical: 'https://openvibe.news/', image: null })));
assert.ok(!/og:image/.test(shell.page({ service: 'news' })), 'no canonical, no relative og:image');
assert.ok(!/og:image/.test(shell.page({ service: 'news' })), 'no canonical, no relative og:image');
assert.ok(!/og:image/.test(shell.page({ service: 'no-such-site', canonical: 'https://x.example/' })));
assert.ok(!/og:image/.test(shell.page({ service: 'no-such-site', canonical: 'https://x.example/' })));
+ assert.match(shell.page({ name: 'OpenVibe.Watch', canonical: 'https://openvibe.watch/', navbar: { service: 'watch' } }), /og:image" content="https:\/\/openvibe\.watch\/shared\/social\/watch\.jpg\?v=/, 'the navbar names the service');
+ assert.match(shell.page({ name: 'OpenVibe.Food', canonical: 'https://openvibe.food/', footer: { service: 'food' } }), /social\/food\.jpg/, 'or the footer does');
console.log('social: ok');
console.log('social: ok');
})().catch((e) => { console.error(e); process.exit(1); });
})().catch((e) => { console.error(e); process.exit(1); });