Changeset 1e2e9e7 in Klonkt for src/views/pages/post.ejs


Ignore:
Timestamp:
06/19/2026 09:38:20 AM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
8cdb377
Parents:
f4b7b6a
Message:

ui(fan-gate): show Newer/Older post navigation on the fan gate too

The fan gate (login wall of a fan_only post, e.g. /fans) was a dead end:
no navigation. Nav is now in a shared partial partials/post-nav.ejs, used
by both post.ejs and fan-gate.ejs. posts.js calculates the neighbours via
a shared postNeighbors() helper, also in the fan-gate branch.

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

File:
1 edited

Legend:

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

    rf4b7b6a r1e2e9e7  
    77<article class="container post-page">
    88
    9   <%# Navigatie over ALLE posts — BOVEN de post (Newer links, Older rechts). %>
    10   <% if (newerPost || olderPost) { %>
    11     <nav class="post-nav post-nav--top">
    12       <% if (newerPost) { %>
    13         <a class="post-nav-prev" href="<%= newerPost._urlBase || '' %>/<%= newerPost.slug %>"<% if (!newerPost._urlBase) { %>
    14            hx-get="/<%= newerPost.slug %>?partial=1" hx-target="#pcms-main"
    15            hx-push-url="/<%= newerPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
    16           <span class="post-nav-label">← Newer</span>
    17           <span class="post-nav-title"><%= newerPost.title %></span>
    18         </a>
    19       <% } else { %>
    20         <div class="post-nav-prev is-empty" aria-hidden="true">
    21           <span class="post-nav-label">← Newer</span>
    22           <span class="post-nav-title">Nieuwste post</span>
    23         </div>
    24       <% } %>
    25       <% if (olderPost) { %>
    26         <a class="post-nav-next" href="<%= olderPost._urlBase || '' %>/<%= olderPost.slug %>"<% if (!olderPost._urlBase) { %>
    27            hx-get="/<%= olderPost.slug %>?partial=1" hx-target="#pcms-main"
    28            hx-push-url="/<%= olderPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
    29           <span class="post-nav-label">Older →</span>
    30           <span class="post-nav-title"><%= olderPost.title %></span>
    31         </a>
    32       <% } else { %>
    33         <div class="post-nav-next is-empty" aria-hidden="true">
    34           <span class="post-nav-label">Older →</span>
    35           <span class="post-nav-title">Oudste post</span>
    36         </div>
    37       <% } %>
    38     </nav>
    39   <% } %>
     9  <%# Navigatie over ALLE posts — BOVEN de post (gedeeld partial). %>
     10  <%- include('../partials/post-nav', { newerPost: newerPost, olderPost: olderPost }) %>
    4011
    4112  <% if (post.cover_image_url) { %>
     
    290261.tag:hover { background: var(--accent); color: white; }
    291262.post-actions { display: flex; gap: 0.5rem; margin: 2rem 0; padding: 1rem; background: var(--paper-2); border-radius: 6px; flex-wrap: wrap; }
    292 .post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
    293 /* Boven de post: geen lijn/gap erboven, maar een scheidingslijn ERONDER (naar de content). */
    294 .post-nav--top { margin-top: 0; padding-top: 0; border-top: 0; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
    295 .post-nav-prev, .post-nav-next { display: flex; flex-direction: column; padding: 1rem; background: var(--paper-2); border-radius: 6px; text-decoration: none; color: var(--ink); }
    296 /* Lege plek (geen nieuwere/oudere post): zelfde kaart, uitgegrijsd + niet klikbaar,
    297    zodat elke post dezelfde twee-kaarten-structuur houdt. */
    298 .post-nav-prev.is-empty, .post-nav-next.is-empty { opacity: 0.4; cursor: default; }
    299 .post-nav-prev.is-empty .post-nav-title, .post-nav-next.is-empty .post-nav-title { font-weight: 400; font-style: italic; color: var(--ink-muted); }
    300 .post-nav-next { text-align: right; align-items: flex-end; }
    301 .post-nav-label { font-size: 0.8rem; color: var(--ink-muted); margin-bottom: 0.25rem; }
    302 .post-nav-title { font-weight: 500; }
    303 @media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } }
    304263
    305264/* ============================================================
Note: See TracChangeset for help on using the changeset viewer.