This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix island:search arg parsing, add Open Graph meta tags for island pages

Fix bug where first positional arg was filtered out when --top absent
(topIdx=-1 caused i!==0 to exclude index 0). Add og:title,
og:description, og:type, and twitter card meta tags to island detail
pages so link previews show the island title instead of "Stigmergic".

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>

author
nandi
co-author
Letta Code
date (May 19, 2026, 8:08 AM -0700) commit ce43e0fd parent 739d13d0
+20 -3
+1 -1
src/island-search.ts
··· 107 107 const topEq = args.find(a => a.startsWith('--top=')); 108 108 const topIdx = args.indexOf('--top'); 109 109 const topN = topEq ? Number(topEq.split('=')[1]) : topIdx >= 0 ? Number(args[topIdx + 1]) : 5; 110 - const query = args.filter((a, i) => a !== '--json' && !a.startsWith('--top=') && a !== '--top' && i !== topIdx + 1).join(' ').trim(); 110 + const query = args.filter((a, i) => a !== '--json' && !a.startsWith('--top=') && a !== '--top' && (topIdx < 0 || i !== topIdx + 1)).join(' ').trim(); 111 111 if (!query) usage(); 112 112 return { query, topN: Number.isFinite(topN) && topN > 0 ? topN : 5, json }; 113 113 }
+19 -2
src/worker.ts
··· 1337 1337 console.error("Failed to load island data:", e); 1338 1338 } 1339 1339 1340 + // Build OG tags from island data 1341 + let ogTags = ""; 1342 + try { 1343 + const islandData = JSON.parse(islandDataJson); 1344 + const title = islandData?.island?.strata?.title || islandData?.island?.summary || "Island"; 1345 + const description = islandData?.island?.strata?.synthesis?.slice(0, 200) || islandData?.island?.strata?.tensions?.[0] || ""; 1346 + const nodeCount = islandData?.island?.vertices?.length || 0; 1347 + const edgeCount = islandData?.island?.edges?.length || 0; 1348 + const fullTitle = `${title} — Stigmergic`; 1349 + ogTags = `<meta property="og:title" content="${fullTitle.replace(/"/g, "&quot;")}"> 1350 + <meta property="og:description" content="${description.replace(/"/g, "&quot;")}"> 1351 + <meta property="og:type" content="article"> 1352 + <meta name="twitter:card" content="summary"> 1353 + <meta name="twitter:title" content="${fullTitle.replace(/"/g, "&quot;")}"> 1354 + <meta name="twitter:description" content="${description.replace(/"/g, "&quot;")}">`; 1355 + } catch {} 1356 + 1340 1357 const page = LANDING_PAGE.replace( 1341 1358 "</head>", 1342 - `<script>window.__ISLANDS__=${islandsJson};window.__ISLAND_DATA__=${islandDataJson};</script></head>`, 1343 - ); 1359 + `${ogTags}<script>window.__ISLANDS__=${islandsJson};window.__ISLAND_DATA__=${islandDataJson};</script></head>`, 1360 + ).replace("<title>Stigmergic</title>", `<title>${(JSON.parse(islandDataJson)?.island?.strata?.title || JSON.parse(islandDataJson)?.island?.summary || "Island")} — Stigmergic</title>`); 1344 1361 return c.html(page); 1345 1362 }); 1346 1363