Skip to content

Commit 719fbf9

Browse files
beacon: nostr.social OGP branding + home banner image
- OGP/site_name/titles now read 'nostr.social' (the public brand); beacon stays the engine (footer credit). Profile titles: '<name> · nostr.social'. - Home/og:image banner (public/og.png, 1200x630) rendered to the site palette; used as default og:image (fallback for picture-less profiles too). - twitter:card now summary_large_image throughout.
1 parent c99aa28 commit 719fbf9

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

public/og.png

280 KB
Loading

src/server.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,25 @@ const shell = () => (SHELL ??= readFileSync(path.join(PUBLIC, 'index.html'), 'ut
1818
// Inject <title> + Open Graph / Twitter meta into the SPA shell at <!--OGP-->.
1919
function renderShell(meta = {}) {
2020
const m = {
21-
title: 'Beacon · a directory of did:nostr identities',
21+
title: 'nostr.social · a directory of did:nostr identities',
2222
description: 'Profiles, the follow graph, and a verifiable DID document for every did:nostr key — indexed live from Nostr.',
23-
url: `${SITE}/`, type: 'website', image: '', ...meta,
23+
url: `${SITE}/`, type: 'website', ...meta,
2424
};
25+
const image = m.image || `${SITE}/og.png`; // fall back to the site banner
2526
const tags = [
2627
`<title>${escAttr(m.title)}</title>`,
2728
`<meta name="description" content="${escAttr(m.description)}">`,
28-
`<meta property="og:site_name" content="Beacon">`,
29+
`<meta property="og:site_name" content="nostr.social">`,
2930
`<meta property="og:type" content="${escAttr(m.type)}">`,
3031
`<meta property="og:title" content="${escAttr(m.title)}">`,
3132
`<meta property="og:description" content="${escAttr(m.description)}">`,
3233
`<meta property="og:url" content="${escAttr(m.url)}">`,
33-
m.image && `<meta property="og:image" content="${escAttr(m.image)}">`,
34-
`<meta name="twitter:card" content="${m.image ? 'summary_large_image' : 'summary'}">`,
34+
`<meta property="og:image" content="${escAttr(image)}">`,
35+
`<meta name="twitter:card" content="summary_large_image">`,
3536
`<meta name="twitter:title" content="${escAttr(m.title)}">`,
3637
`<meta name="twitter:description" content="${escAttr(m.description)}">`,
37-
m.image && `<meta name="twitter:image" content="${escAttr(m.image)}">`,
38-
].filter(Boolean).join('\n ');
38+
`<meta name="twitter:image" content="${escAttr(image)}">`,
39+
].join('\n ');
3940
return shell().replace('<!--OGP-->', tags);
4041
}
4142

@@ -61,7 +62,7 @@ export async function startServer(port = process.env.PORT || 3000) {
6162
const name = c.name || c.display_name || `did:nostr:${id.slice(0, 8)}…`;
6263
const about = String(c.about || `A did:nostr identity · ${id.slice(0, 16)}…`).replace(/\s+/g, ' ').slice(0, 180);
6364
res.type('html').send(renderShell({
64-
title: `${name} · Beacon`, description: about, url: `${SITE}/${id}`,
65+
title: `${name} · nostr.social`, description: about, url: `${SITE}/${id}`,
6566
type: 'profile', image: c.picture || '',
6667
}));
6768
} catch (e) { next(e); }

0 commit comments

Comments
 (0)