Changeset 834bcc3 in Klonkt for src/routes/hub.js
- Timestamp:
- 06/23/2026 06:14:27 PM (3 months ago)
- Branches:
- main
- Children:
- d774679
- Parents:
- bb42dfb
- File:
-
- 1 edited
-
src/routes/hub.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/hub.js
rbb42dfb r834bcc3 1 1 /** 2 * Hub -hoofdpagina — alleen in hub-modus. In plaats van de primaire Klonkt-site te3 * tonen, rendert '/' hier een bedrijfs-overview: de laatste posts van ALLE4 * gebruikers samengevat + een lijst van de Klonkt-site's.2 * Hub home page — hub mode only. Instead of rendering the primary Klonkt site, 3 * '/' renders a company overview here: the latest posts from ALL users combined 4 * + a list of the Klonkt sites. 5 5 * 6 * In solo -modus doet dit niets (next()) en rendert posts.js de enige site.6 * In solo mode this does nothing (next()) and posts.js renders the single site. 7 7 */ 8 8 … … 16 16 router.get('/', (req, res, next) => { 17 17 if (getTenancy() !== 'hub') return next(); 18 // Als resolveSite een specifieke site adresseerde (/user/:slug of/sites/:slug),19 // is req.url naar '/' herschreven — dan NIET de overview tonen maar de site zelf20 // laten renderen door posts.js. siteUrlBase is dan gezet.18 // If resolveSite addressed a specific site (/user/:slug or /sites/:slug), 19 // req.url was rewritten to '/' — do NOT show the overview but let posts.js 20 // render the site itself. siteUrlBase is set in that case. 21 21 if (res.locals.siteUrlBase) return next(); 22 22 23 // La atste gepubliceerde posts over álle sites heen.23 // Latest published posts across all sites. 24 24 const posts = db.prepare(` 25 25 SELECT p.title, p.slug, p.excerpt, p.published_at, p.created_at, … … 35 35 `).all(); 36 36 37 // De hoofd-/labelsite (de expliciet primaire = de bedrijfs-/hoofdaccount) is38 // GEEN artiest; die tonen we apart bovenaan, niet in de Artiesten-roster.37 // The main/label site (the explicitly primary = the company/main account) is 38 // NOT an artist; we display it separately at the top, not in the Artists roster. 39 39 const mainSite = db.prepare(` 40 40 SELECT s.id, s.slug, s.title, s.tagline, s.profile_photo, s.accent, … … 48 48 const mainId = mainSite ? mainSite.id : ''; 49 49 50 // Uitgelichte Klonkt-site's voor de home-roster: meest-actief eerst (aantal51 // gepubliceerde posts), dan nieuwste. Excl. de hoofdsite. Beperkt tot52 // HOME_ROSTER_LIMIT zodat de home schaalt — volledige lijst staat op/leden.50 // Featured Klonkt sites for the home roster: most active first (number of 51 // published posts), then newest. Excl. the main site. Capped at 52 // HOME_ROSTER_LIMIT so the home scales — full list is at /leden. 53 53 const HOME_ROSTER_LIMIT = 24; 54 54 const artists = db.prepare(` … … 64 64 const totalArtists = db.prepare('SELECT COUNT(*) AS c FROM sites WHERE id != ?').get(mainId).c; 65 65 66 // De hub-pagina is GENERIEK (van geen enkele user) — branding komt uit globale67 // instellingen die de admin in Beheer beheert, niet uit eensite.66 // The hub page is GENERIC (not belonging to any user) — branding comes from global 67 // settings managed by the admin in the admin panel, not from a site. 68 68 const hub = { 69 69 title: getSetting('hub_title') || 'Overzicht',
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)