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


Ignore:
Timestamp:
06/15/2026 04:02:17 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
11a6871
Parents:
33886fb
Message:

fix: post navigation over ALL posts incl. pinned (no more pinned-only stack)

A pinned post showed only the pinned-stack navigation at the bottom. Now
Newer/Older runs through all posts in canonical feed order: solo = pinned
first by rank, then by date (same as the homepage); hub = globally by date.
Pinned posts simply sit in the continuous sequence. Neighbours determined
by index in that ordered list. The separate pinned-stack navigation
(PREVIOUS PINNED / TOP / BOTTOM) has been removed.

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

File:
1 edited

Legend:

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

    r33886fb r6117035  
    233233  <% } %>
    234234
    235   <%# ── Pinned navigation (only when current post is pinned) ───
    236       Two card-style links: "Vorige vastgepinde" / "Volgende vastgepinde".
    237       Edge-of-stack states show "← BOVENAAN — Nieuwste post" or the equivalent
    238       for the bottom. Layout mirrors v9 exactly. %>
    239   <% if (post.pinned) { %>
    240     <nav class="post-pinned-nav" aria-label="Pinned navigation">
    241       <%# LEFT card: post one step UP the pinned stack (towards #1).
    242           Uses prevPinnedPost which now means "smaller rank". %>
    243       <% if (prevPinnedPost) { %>
    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">
    247           <span class="post-pinned-arrow" aria-hidden="true">←</span>
    248           <span class="post-pinned-body">
    249             <span class="post-pinned-label">📌 Vorige vastgepinde</span>
    250             <span class="post-pinned-title"><%= prevPinnedPost.title %></span>
    251             <span class="post-pinned-cta">Lees deze post →</span>
    252           </span>
    253         </a>
    254       <% } else if (pinnedTopOfStack) { %>
    255         <span class="post-pinned-card post-pinned-card--edge">
    256           <span class="post-pinned-edge-label">— BOVENAAN —</span>
    257           <span class="post-pinned-edge-title">Nieuwste post</span>
    258         </span>
    259       <% } %>
    260 
    261       <%# RIGHT card: post one step DOWN the pinned stack (away from #1).
    262           Uses nextPinnedPost which now means "larger rank". %>
    263       <% if (nextPinnedPost) { %>
    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">
    267           <span class="post-pinned-arrow" aria-hidden="true">→</span>
    268           <span class="post-pinned-body">
    269             <span class="post-pinned-label">📌 Volgende vastgepinde</span>
    270             <span class="post-pinned-title"><%= nextPinnedPost.title %></span>
    271             <span class="post-pinned-cta">← Lees deze post</span>
    272           </span>
    273         </a>
    274       <% } else if (pinnedBottomOfStack) { %>
    275         <span class="post-pinned-card post-pinned-card--edge">
    276           <span class="post-pinned-edge-label">— ONDERAAN —</span>
    277           <span class="post-pinned-edge-title">Oudste post</span>
    278         </span>
    279       <% } %>
    280     </nav>
    281   <% } %>
    282 
    283   <%# ── Chronological prev/next (kept for non-pinned posts) ──────
    284       For pinned posts the pinned-nav above replaces this. Non-pinned
    285       regular posts still get the simple older/newer pair. %>
    286   <% if (!post.pinned && (prevPost || nextPost)) { %>
     235  <%# ── Navigatie over ALLE posts (pinned + niet-pinned in de feed-volgorde) ──
     236      Newer links (← omhoog in de lijst), Older rechts (→ omlaag). Vervangt de
     237      vroegere pinned-only stack-navigatie: pinned posts zitten gewoon in de
     238      doorlopende reeks. .post-nav-prev = linker kolom, .post-nav-next = rechter. %>
     239  <% if (newerPost || olderPost) { %>
    287240    <nav class="post-nav">
    288       <%# Newer links, Older rechts (lijst nieuwste-eerst → naar rechts = ouder).
    289           .post-nav-prev = linker kolom (links uitgelijnd), .post-nav-next =
    290           rechter kolom (rechts uitgelijnd). %>
    291       <% if (nextPost) { %>
    292         <a class="post-nav-prev" href="<%= nextPost._urlBase || '' %>/<%= nextPost.slug %>"<% if (!nextPost._urlBase) { %>
    293            hx-get="/<%= nextPost.slug %>?partial=1" hx-target="#pcms-main"
    294            hx-push-url="/<%= nextPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
     241      <% if (newerPost) { %>
     242        <a class="post-nav-prev" href="<%= newerPost._urlBase || '' %>/<%= newerPost.slug %>"<% if (!newerPost._urlBase) { %>
     243           hx-get="/<%= newerPost.slug %>?partial=1" hx-target="#pcms-main"
     244           hx-push-url="/<%= newerPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
    295245          <span class="post-nav-label">← Newer</span>
    296           <span class="post-nav-title"><%= nextPost.title %></span>
     246          <span class="post-nav-title"><%= newerPost.title %></span>
    297247        </a>
    298248      <% } else { %><span></span><% } %>
    299       <% if (prevPost) { %>
    300         <a class="post-nav-next" href="<%= prevPost._urlBase || '' %>/<%= prevPost.slug %>"<% if (!prevPost._urlBase) { %>
    301            hx-get="/<%= prevPost.slug %>?partial=1" hx-target="#pcms-main"
    302            hx-push-url="/<%= prevPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
     249      <% if (olderPost) { %>
     250        <a class="post-nav-next" href="<%= olderPost._urlBase || '' %>/<%= olderPost.slug %>"<% if (!olderPost._urlBase) { %>
     251           hx-get="/<%= olderPost.slug %>?partial=1" hx-target="#pcms-main"
     252           hx-push-url="/<%= olderPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
    303253          <span class="post-nav-label">Older →</span>
    304           <span class="post-nav-title"><%= prevPost.title %></span>
     254          <span class="post-nav-title"><%= olderPost.title %></span>
    305255        </a>
    306256      <% } %>
Note: See TracChangeset for help on using the changeset viewer.