openvibers/openvibe.shared Commits

Shared 4.0.1: the share card follows the navbar or footer service (#63)

OP OpenVibers committed 11 Oct 2026 · f85a3ec798 · 6 files, +21 −5

* Shared 4.0.1: the share card follows the navbar or footer service

`shell.page()` now finds the site's share card from `navbar.service` or `footer.service` when the page itself names no `service`. Most sites (Actor, Watch, Food, Codes, Services, Help, Work, Quest, Rent, MediaHub) set the service only there, so after 4.0.0 they still had no `og:image`.

Tests: `social` (two new cases), `shell`, `docs-status`, `package`.

* 4.0.2: the template pins openvibe-shared v4.0.0; 4.0.1 was tagged on the 4.0.0 commit in error

Changes

ddiff --git a/CHANGELOG.md b/CHANGELOG.md
iindex 655d1f8..902962d 100644
---- a/CHANGELOG.md
++++ b/CHANGELOG.md
@@@ -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.
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
ddiff --git a/STATUS.json b/STATUS.json
iindex 8a7be55..b68fdc4 100644
---- a/STATUS.json
++++ b/STATUS.json
@@@ -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)",
ddiff --git a/package.json b/package.json
iindex 58f511c..1faab28 100644
---- a/package.json
++++ b/package.json
@@@ -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": {
ddiff --git a/shell.js b/shell.js
iindex 8a8ba37..197b6ae 100644
---- a/shell.js
++++ b/shell.js
@@@ -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 = {}) {
ddiff --git a/templates/site/package.json b/templates/site/package.json
iindex 963536b..9f9584a 100644
---- a/templates/site/package.json
++++ b/templates/site/package.json
@@@ -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"
}
}
ddiff --git a/test/social.test.js b/test/social.test.js
iindex 61b4df9..70391ba 100644
---- a/test/social.test.js
++++ b/test/social.test.js
@@@ -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); });