From f3a3d88c7d5a86ae1fa06cf23932631eaa050151 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 22 Oct 2026 08:42:47 -0700 Subject: Links to coinos unfurl with a share card: site-wide Open Graph/Twitter tags and a 1200×630 og-image.png. Note and profile pages swap the site's tags for their own and fall back to the card when they have no picture. README links coinosv3-server on gittr. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- feed/profile-page.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'feed/profile-page.js') diff --git a/feed/profile-page.js b/feed/profile-page.js index a30c2ab..623dc09 100644 --- a/feed/profile-page.js +++ b/feed/profile-page.js @@ -11,7 +11,7 @@ // page goes out (and the build carries on into the cache). import { decode } from 'nostr-tools/nip19'; import { verifyEvent } from 'nostr-tools/pure'; -import { NOTE_RELAYS, esc, scriptJson } from './note-page.js'; +import { NOTE_RELAYS, esc, scriptJson, siteTagsOut, siteImage } from './note-page.js'; export const PROFILE_PATH = /^\/((?:npub1|nprofile1)[a-z0-9]+|[A-Za-z0-9._-]{1,30})\/?$/; // single-segment app routes and files that are never a person @@ -186,14 +186,14 @@ export function renderProfilePage(html, data, ref, origin) { desc ? `` : '', desc ? `` : '', origin ? `` : '', - picture ? `` : '', - ``, + picture || siteImage(origin) ? `` : '', + ``, // the face and the cover start downloading with the page picture ? `` : '', banner ? `` : '', ``, ].filter(Boolean).join('\n'); - let out = html.replace(/[^<]*<\/title>/i, `<title>${esc(title)}`); + let out = siteTagsOut(html).replace(/[^<]*<\/title>/i, `<title>${esc(title)}`); out = out.includes('') ? out.replace('', head + '\n') : head + out; return out; } -- cgit v1.2.3