Changeset cf4cf27 in Klonkt for src/routes/circle.js


Ignore:
Timestamp:
06/26/2026 05:10:47 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
eacd3d6
Parents:
eefd302
Message:

feat(circle): show only the post title in the feed + 2x larger source link

Circle feed used the whole post text as the title (run-on). Now extract just the
title (the note's bold first line); title-less notes fall back to a snippet. And the
'van <site>' source link (with ⛓ icon) is 2x larger (.72rem -> 1.44rem). style.css?v=55.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/circle.js

    reefd302 rcf4cf27  
    3333  const posts = ActivityPubService.getCirkelPosts(site.slug, 80).map((r) => {
    3434    const text = htmlToText(r.content);
     35    // Show ONLY the title (the bold first line a Klonkt note carries), not the whole
     36    // body. Title-less notes (e.g. plain Mastodon) fall back to a short text snippet.
     37    const titleM = (r.content || '').match(/^\s*<p>\s*<strong>([\s\S]*?)<\/strong>/i);
     38    const realTitle = titleM ? htmlToText(titleM[1]).trim() : '';
    3539    const image = mediaImage(r.media_json);
    3640    const name = r.author_name || r.author_handle || 'Onbekend';
     
    3842      id: 'ap-' + r.id,
    3943      slug: '',
    40       title: text ? (text.length > 90 ? text.slice(0, 90) + '…' : text) : name,
     44      title: realTitle
     45        ? (realTitle.length > 90 ? realTitle.slice(0, 90) + '…' : realTitle)
     46        : (text ? (text.length > 90 ? text.slice(0, 90) + '…' : text) : name),
    4147      excerpt: '',
    4248      cover_image_url: image ? image.url : null,
Note: See TracChangeset for help on using the changeset viewer.