Changeset ce8c8c2 in Klonkt for src/routes/hub.js


Ignore:
Timestamp:
06/14/2026 06:46:13 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
74c2473
Parents:
a3169f5
Message:

feat: hub-home shows main/label account separately (not under Artists)

The main site (oldest = company/main account, e.g. Studio Noord) appeared
among the artists. Now it gets a highlighted "Main page" card above the roster
and is excluded from both the Artists roster and the /artiesten directory
(a label is not an artist).

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/hub.js

    ra3169f5 rce8c8c2  
    3535  `).all();
    3636
     37  // De hoofd-/labelsite (oudste = de bedrijfs-/hoofdaccount) is GEEN artiest;
     38  // die tonen we apart bovenaan, niet in de Artiesten-roster.
     39  const mainSite = db.prepare(`
     40    SELECT s.id, s.slug, s.title, s.tagline, s.profile_photo, s.accent,
     41           u.avatar_url AS owner_avatar,
     42           (SELECT COUNT(*) FROM posts WHERE site_id = s.id AND status = 'published') AS post_count
     43    FROM sites s
     44    LEFT JOIN users u ON u.id = s.owner_id
     45    ORDER BY s.created_at ASC
     46    LIMIT 1
     47  `).get() || null;
     48  const mainId = mainSite ? mainSite.id : '';
     49
    3750  // Uitgelichte PrutFolio's voor de home-roster: meest-actief eerst (aantal
    38   // gepubliceerde posts), dan nieuwste. Beperkt tot HOME_ROSTER_LIMIT zodat de
    39   // home schaalt — de volledige, doorzoekbare lijst staat op /artiesten.
     51  // gepubliceerde posts), dan nieuwste. Excl. de hoofdsite. Beperkt tot
     52  // HOME_ROSTER_LIMIT zodat de home schaalt — volledige lijst staat op /artiesten.
    4053  const HOME_ROSTER_LIMIT = 24;
    4154  const artists = db.prepare(`
     
    4558    FROM sites s
    4659    LEFT JOIN users u ON u.id = s.owner_id
     60    WHERE s.id != @mainId
    4761    ORDER BY post_count DESC, s.created_at DESC
    48     LIMIT ?
    49   `).all(HOME_ROSTER_LIMIT);
    50   const totalArtists = db.prepare('SELECT COUNT(*) AS c FROM sites').get().c;
     62    LIMIT @limit
     63  `).all({ mainId, limit: HOME_ROSTER_LIMIT });
     64  const totalArtists = db.prepare('SELECT COUNT(*) AS c FROM sites WHERE id != ?').get(mainId).c;
    5165
    5266  // De hub-pagina is GENERIEK (van geen enkele user) — branding komt uit globale
     
    6478    bodyClass: 'on-home on-hub',
    6579    hub,
     80    mainSite,
    6681    artists,
    6782    totalArtists,
Note: See TracChangeset for help on using the changeset viewer.