Changeset 0fa59c3 in Klonkt for src/routes


Ignore:
Timestamp:
06/26/2026 03:56:42 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
84903a1
Parents:
cb3d5fc
Message:

feat(fedi): rename Timeline tab/route to Newspaper (/timeline -> /newspaper)

Renamed the feed: tab label + page title -> 'Newspaper', route /timeline -> /newspaper
(+ all sub-routes, form actions, links, render path, view file timeline.ejs->newspaper.ejs,
RESERVED_SLUGS). The Following page now shows its own title instead of the feed's.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/posts.js

    rcb3d5fc r0fa59c3  
    8585  'tag', 'type', 'user', 'users', 'artiesten', 'leden', 'favorieten', 'feed.xml', 'atom.xml', 'sitemap.xml',
    8686  'manifest.webmanifest', 'sw.js', 'favicon.ico', 'favicon.svg', 'assets',
    87   'authorize_interaction', 'fediverse', 'timeline', 'following', 'notifications', 'blocking',
     87  'authorize_interaction', 'fediverse', 'newspaper', 'following', 'notifications', 'blocking',
    8888]);
    8989
     
    597597}
    598598
    599 router.get('/timeline', requireSiteManager, (req, res) => {
     599router.get('/newspaper', requireSiteManager, (req, res) => {
    600600  const site = res.locals.site;
    601601  const timeline = (site ? ActivityPubService.getTimeline(site.slug, 60) : [])
    602602    .map((p) => ({ ...p, embedHtml: timelineEmbedHtml(p.content) }));
    603   renderPage(req, res, 'pages/timeline', {
     603  renderPage(req, res, 'pages/newspaper', {
    604604    pageTitle: 'Tijdlijn', bodyClass: 'on-special',
    605605    timeline,
     
    619619});
    620620
    621 router.post('/timeline/follow', requireSiteManager, async (req, res) => {
     621router.post('/newspaper/follow', requireSiteManager, async (req, res) => {
    622622  const site = res.locals.site;
    623623  const handle = (req.body.handle || '').toString();
     
    635635});
    636636
    637 router.post('/timeline/unfollow', requireSiteManager, async (req, res) => {
     637router.post('/newspaper/unfollow', requireSiteManager, async (req, res) => {
    638638  const site = res.locals.site;
    639639  const actorUri = (req.body.actor_uri || '').toString();
     
    643643
    644644// Toggle "Featured" (show this account's posts in your Cirkel) on an account you follow.
    645 router.post('/timeline/autoboost', requireSiteManager, (req, res) => {
     645router.post('/newspaper/autoboost', requireSiteManager, (req, res) => {
    646646  const site = res.locals.site;
    647647  const actorUri = (req.body.actor_uri || '').toString();
     
    650650});
    651651
    652 router.post('/timeline/like', requireSiteManager, async (req, res) => {
     652router.post('/newspaper/like', requireSiteManager, async (req, res) => {
    653653  const site = res.locals.site;
    654654  if (site) { try { await ActivityPubService.sendInteraction(site, 'like', (req.body.note || '').toString(), (req.body.author || '').toString()); } catch (e) { /* ignore */ } }
    655   res.redirect('/timeline?success=' + encodeURIComponent('Geliket ⭐'));
    656 });
    657 
    658 router.post('/timeline/boost', requireSiteManager, async (req, res) => {
     655  res.redirect('/newspaper?success=' + encodeURIComponent('Geliket ⭐'));
     656});
     657
     658router.post('/newspaper/boost', requireSiteManager, async (req, res) => {
    659659  const site = res.locals.site;
    660660  const note = (req.body.note || '').toString();
     
    663663    ActivityPubService.markBoosted(site.slug, note); // also surface it in the Cirkel (mixed by date)
    664664  }
    665   res.redirect('/timeline?success=' + encodeURIComponent('Geboost 🔁'));
     665  res.redirect('/newspaper?success=' + encodeURIComponent('Geboost 🔁'));
    666666});
    667667
    668668// Unboost (retract): send Undo(Announce) + clear the local flag.
    669 router.post('/timeline/unboost', requireSiteManager, async (req, res) => {
     669router.post('/newspaper/unboost', requireSiteManager, async (req, res) => {
    670670  const site = res.locals.site;
    671671  const note = (req.body.note || '').toString();
     
    674674    ActivityPubService.unmarkBoosted(site.slug, note);
    675675  }
    676   res.redirect('/timeline?success=' + encodeURIComponent('Boost ingetrokken'));
     676  res.redirect('/newspaper?success=' + encodeURIComponent('Boost ingetrokken'));
    677677});
    678678
     
    705705  }
    706706  const ref = req.get('Referer') || '';
    707   res.redirect((ref.includes('/timeline') ? '/timeline?' : '/blocking?') + q);
     707  res.redirect((ref.includes('/newspaper') ? '/newspaper?' : '/blocking?') + q);
    708708});
    709709
Note: See TracChangeset for help on using the changeset viewer.