Changeset 834bcc3 in Klonkt for src/routes/epk.js
- Timestamp:
- 06/23/2026 06:14:27 PM (3 months ago)
- Branches:
- main
- Children:
- d774679
- Parents:
- bb42dfb
- File:
-
- 1 edited
-
src/routes/epk.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/epk.js
rbb42dfb r834bcc3 1 1 /** 2 * EPK / p erskit (premium) — een deelbare perspagina per Klonkt-site.2 * EPK / press kit (premium) — a shareable press page per Klonkt site. 3 3 * 4 * GET /pers (solo) o f/user/:slug/pers (hub, via resolveSite + siteUrlBase)5 * -> nette, openbare perskit: hero (foto/titel/tagline), korte bio, topnummers,6 * recent e posts en een contact-knop. Bedoeld om naar boekers/pers te sturen.4 * GET /pers (solo) or /user/:slug/pers (hub, via resolveSite + siteUrlBase) 5 * -> clean, public press kit: hero (photo/title/tagline), short bio, top tracks, 6 * recent posts and a contact button. Intended to share with bookers/press. 7 7 * 8 * Premium-gated: n iet-premium instances hebben GEEN /pers (next() -> 404 via de9 * catch-all). De PAGINA zelf is openbaar (geen login) zodat pers 'm kan bekijken;10 * alleen het BESTAAN ervan is premium. Geen login-e-mail lekken: contact loopt via11 * e en expliciet ingesteld pers-adres (epk_contact, per site) of anders de site zelf.8 * Premium-gated: non-premium instances have NO /pers (next() -> 404 via the 9 * catch-all). The PAGE itself is public (no login) so press can view it; 10 * only its EXISTENCE is premium. No login email leak: contact goes via an 11 * explicitly configured press address (epk_contact, per site) or the site itself. 12 12 */ 13 13 … … 21 21 22 22 router.get('/pers', (req, res, next) => { 23 if (!premiumUnlocked()) return next(); // geen premium -> geen perskit23 if (!premiumUnlocked()) return next(); // no premium -> no press kit 24 24 const site = res.locals.site; 25 25 if (!site) return next(); 26 26 27 // Nummers op de perskit: een door de admin GEKOZEN selectie (max 5, in eigen28 // volgorde) als die is ingesteld; anders automatisch de top 5 meest beluisterde.27 // Tracks on the press kit: an admin-CHOSEN selection (max 5, in custom order) 28 // if configured; otherwise automatically the top 5 most-listened. 29 29 let chosenIds = []; 30 30 try { 31 31 const raw = JSON.parse(getSetting('epk_tracks_' + site.id, '') || '[]'); 32 32 if (Array.isArray(raw)) chosenIds = raw.filter((x) => typeof x === 'string').slice(0, 5); 33 } catch (e) { /* ongeldige JSON → val terug optop */ }33 } catch (e) { /* invalid JSON → fall back to top */ } 34 34 35 35 let tracks; … … 41 41 ).all(site.id, ...chosenIds); 42 42 const byId = new Map(rows.map((r) => [r.id, r])); 43 tracks = chosenIds.map((id) => byId.get(id)).filter(Boolean); // behoud gekozen volgorde43 tracks = chosenIds.map((id) => byId.get(id)).filter(Boolean); // preserve chosen order 44 44 } else { 45 45 tracks = db.prepare( … … 60 60 ).all(site.id); 61 61 62 // P ers-contact: per-site instelling (epk_contact_<siteId>) als die er is, anders63 // de globale epk_contact. NOOIT automatisch de login-mail tonen.62 // Press contact: per-site setting (epk_contact_<siteId>) if present, otherwise 63 // the global epk_contact. NEVER auto-expose the login email. 64 64 const contact = (getSetting('epk_contact_' + site.id, '') || getSetting('epk_contact', '') || '').trim(); 65 // Korte pers-bio: per-site instelling, anders de tagline van de site.65 // Short press bio: per-site setting, otherwise the site's tagline. 66 66 const bio = (getSetting('epk_bio_' + site.id, '') || site.tagline || '').trim(); 67 67
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)