| [834bcc3] | 1 | <%# Post navigation (Newer link left / Older right) — shared by post.ejs and
|
|---|
| 2 | fan-gate.ejs. Expects newerPost + olderPost in scope. If a neighbour is missing,
|
|---|
| 3 | a greyed-out placeholder keeps every post in the same two-card structure. %>
|
|---|
| [1e2e9e7] | 4 | <% if ((typeof newerPost !== 'undefined' && newerPost) || (typeof olderPost !== 'undefined' && olderPost)) { %>
|
|---|
| 5 | <nav class="post-nav post-nav--top">
|
|---|
| 6 | <% if (newerPost) { %>
|
|---|
| 7 | <a class="post-nav-prev" href="<%= newerPost._urlBase || '' %>/<%= newerPost.slug %>"<% if (!newerPost._urlBase) { %>
|
|---|
| 8 | hx-get="/<%= newerPost.slug %>?partial=1" hx-target="#pcms-main"
|
|---|
| 9 | hx-push-url="/<%= newerPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
|
|---|
| [03fa548] | 10 | <span class="post-nav-label"><% if (newerPost.pinned) { %><span class="post-nav-pin" title="Vastgepind">📌</span> <% } %>← <%= t('postnav.newer') %></span>
|
|---|
| [1e2e9e7] | 11 | <span class="post-nav-title"><%= newerPost.title %></span>
|
|---|
| 12 | </a>
|
|---|
| 13 | <% } else { %>
|
|---|
| 14 | <div class="post-nav-prev is-empty" aria-hidden="true">
|
|---|
| 15 | <span class="post-nav-label">← Newer</span>
|
|---|
| [03fa548] | 16 | <span class="post-nav-title"><%= t('postnav.newest') %></span>
|
|---|
| [1e2e9e7] | 17 | </div>
|
|---|
| 18 | <% } %>
|
|---|
| 19 | <% if (olderPost) { %>
|
|---|
| 20 | <a class="post-nav-next" href="<%= olderPost._urlBase || '' %>/<%= olderPost.slug %>"<% if (!olderPost._urlBase) { %>
|
|---|
| 21 | hx-get="/<%= olderPost.slug %>?partial=1" hx-target="#pcms-main"
|
|---|
| 22 | hx-push-url="/<%= olderPost.slug %>" hx-indicator="#pcms-loading"<% } %>>
|
|---|
| [03fa548] | 23 | <span class="post-nav-label"><%= t('postnav.older') %> →<% if (olderPost.pinned) { %> <span class="post-nav-pin" title="Vastgepind">📌</span><% } %></span>
|
|---|
| [1e2e9e7] | 24 | <span class="post-nav-title"><%= olderPost.title %></span>
|
|---|
| 25 | </a>
|
|---|
| 26 | <% } else { %>
|
|---|
| 27 | <div class="post-nav-next is-empty" aria-hidden="true">
|
|---|
| 28 | <span class="post-nav-label">Older →</span>
|
|---|
| [03fa548] | 29 | <span class="post-nav-title"><%= t('postnav.oldest') %></span>
|
|---|
| [1e2e9e7] | 30 | </div>
|
|---|
| 31 | <% } %>
|
|---|
| 32 | </nav>
|
|---|
| 33 | <% } %>
|
|---|
| 34 |
|
|---|
| 35 | <style>
|
|---|
| 36 | .post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
|
|---|
| [834bcc3] | 37 | /* Above the post: no line/gap above it, but a dividing line BELOW (toward the content). */
|
|---|
| [1e2e9e7] | 38 | .post-nav--top { margin-top: 0; padding-top: 0; border-top: 0; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--rule); }
|
|---|
| 39 | .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); }
|
|---|
| [834bcc3] | 40 | /* Empty slot (no newer/older post): same card, greyed out + not clickable,
|
|---|
| 41 | so every post keeps the same two-card structure. */
|
|---|
| [1e2e9e7] | 42 | .post-nav-prev.is-empty, .post-nav-next.is-empty { opacity: 0.4; cursor: default; }
|
|---|
| 43 | .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); }
|
|---|
| 44 | .post-nav-next { text-align: right; align-items: flex-end; }
|
|---|
| 45 | .post-nav-label { font-size: 0.8rem; color: var(--ink-muted); margin-bottom: 0.25rem; }
|
|---|
| 46 | .post-nav-title { font-weight: 500; }
|
|---|
| [8cdb377] | 47 | .post-nav-pin { font-size: 0.85em; }
|
|---|
| [1e2e9e7] | 48 | @media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } }
|
|---|
| 49 | </style>
|
|---|