Changeset 743bb81 in Klonkt


Ignore:
Timestamp:
06/14/2026 03:15:52 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
6e0249f
Parents:
4d7443b
Message:

hub: fix /user/:slug showed the overview instead of the site + heading "from users"

resolveSite rewrites /user/:slug to req.url='/', causing the hub route
GET / to pick it up again and show the overview instead of the clicked
site. Fix: overview only on the real root (siteUrlBase empty); otherwise
next() -> posts.js renders the site. Section title -> "Latest posts from users".

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

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/routes/hub.js

    r4d7443b r743bb81  
    1616router.get('/', (req, res, next) => {
    1717  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 zelf
     20  // laten renderen door posts.js. siteUrlBase is dan gezet.
     21  if (res.locals.siteUrlBase) return next();
    1822
    1923  // Laatste gepubliceerde posts over álle sites heen.
  • src/views/pages/hub-home.ejs

    r4d7443b r743bb81  
    3838    <% if (posts && posts.length) { %>
    3939    <section class="hub-sec">
    40       <h2 class="hub-sec-title">Laatste posts</h2>
     40      <h2 class="hub-sec-title">Laatste posts van users</h2>
    4141      <div class="hub-feed">
    4242        <% posts.forEach(function(p){ %>
Note: See TracChangeset for help on using the changeset viewer.