Changeset d54dade in Klonkt for src/views/pages/post.ejs


Ignore:
Timestamp:
06/15/2026 03:39:35 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
52badd3
Parents:
7f46817d
Message:

fix: hub mode — related posts + Newer/Older across ALL users

In hub mode "Related posts" and the Newer/Older navigation only pulled from
the current site; now from all sites combined (newest->oldest), with links to
/user/<site-slug>/<post-slug>. Cross-user links use full navigation (the
chrome/header differs per artist); solo + same-context keep the HTMX partial.
Pinned nav stays per-site but now gets the correct siteUrlBase prefix.
Solo mode unchanged.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/post.ejs

    r7f46817d rd54dade  
    212212        <% relatedPosts.forEach(function(rp) { %>
    213213          <li class="post-related-card">
    214             <a href="/<%= rp.slug %>"
     214            <a href="<%= rp._urlBase || '' %>/<%= rp.slug %>"<% if (!rp._urlBase) { %>
    215215               hx-get="/<%= rp.slug %>?partial=1" hx-target="#pcms-main"
    216                hx-push-url="/<%= rp.slug %>" hx-indicator="#pcms-loading">
     216               hx-push-url="/<%= rp.slug %>" hx-indicator="#pcms-loading"<% } %>>
    217217              <% if (rp.cover_image_url) { %>
    218218                <span class="post-related-cover"
     
    242242          Uses prevPinnedPost which now means "smaller rank". %>
    243243      <% if (prevPinnedPost) { %>
    244         <a class="post-pinned-card post-pinned-card--prev" href="/<%= prevPinnedPost.slug %>"
    245            hx-get="/<%= prevPinnedPost.slug %>?partial=1" hx-target="#pcms-main"
    246            hx-push-url="/<%= prevPinnedPost.slug %>" hx-indicator="#pcms-loading">
     244        <a class="post-pinned-card post-pinned-card--prev" href="<%= _base %>/<%= prevPinnedPost.slug %>"
     245           hx-get="<%= _base %>/<%= prevPinnedPost.slug %>?partial=1" hx-target="#pcms-main"
     246           hx-push-url="<%= _base %>/<%= prevPinnedPost.slug %>" hx-indicator="#pcms-loading">
    247247          <span class="post-pinned-arrow" aria-hidden="true">←</span>
    248248          <span class="post-pinned-body">
     
    262262          Uses nextPinnedPost which now means "larger rank". %>
    263263      <% if (nextPinnedPost) { %>
    264         <a class="post-pinned-card post-pinned-card--next" href="/<%= nextPinnedPost.slug %>"
    265            hx-get="/<%= nextPinnedPost.slug %>?partial=1" hx-target="#pcms-main"
    266            hx-push-url="/<%= nextPinnedPost.slug %>" hx-indicator="#pcms-loading">
     264        <a class="post-pinned-card post-pinned-card--next" href="<%= _base %>/<%= nextPinnedPost.slug %>"
     265           hx-get="<%= _base %>/<%= nextPinnedPost.slug %>?partial=1" hx-target="#pcms-main"
     266           hx-push-url="<%= _base %>/<%= nextPinnedPost.slug %>" hx-indicator="#pcms-loading">
    267267          <span class="post-pinned-arrow" aria-hidden="true">→</span>
    268268          <span class="post-pinned-body">
     
    287287    <nav class="post-nav">
    288288      <% if (prevPost) { %>
    289         <a class="post-nav-prev" href="/<%= prevPost.slug %>"
     289        <a class="post-nav-prev" href="<%= prevPost._urlBase || '' %>/<%= prevPost.slug %>"<% if (!prevPost._urlBase) { %>
    290290           hx-get="/<%= prevPost.slug %>?partial=1" hx-target="#pcms-main"
    291            hx-push-url="/<%= prevPost.slug %>" hx-indicator="#pcms-loading">
     291           hx-push-url="/<%= prevPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
    292292          <span class="post-nav-label">← Older</span>
    293293          <span class="post-nav-title"><%= prevPost.title %></span>
     
    295295      <% } else { %><span></span><% } %>
    296296      <% if (nextPost) { %>
    297         <a class="post-nav-next" href="/<%= nextPost.slug %>"
     297        <a class="post-nav-next" href="<%= nextPost._urlBase || '' %>/<%= nextPost.slug %>"<% if (!nextPost._urlBase) { %>
    298298           hx-get="/<%= nextPost.slug %>?partial=1" hx-target="#pcms-main"
    299            hx-push-url="/<%= nextPost.slug %>" hx-indicator="#pcms-loading">
     299           hx-push-url="/<%= nextPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
    300300          <span class="post-nav-label">Newer →</span>
    301301          <span class="post-nav-title"><%= nextPost.title %></span>
Note: See TracChangeset for help on using the changeset viewer.