| 1 | <%
|
|---|
| 2 | // In hub mode the site is accessible under /user/<slug>; all site-scoped links
|
|---|
| 3 | // (tag, edit, delete, comments) must carry that prefix otherwise they fall back
|
|---|
| 4 | // to the primary site → 404 / wrong site. In solo mode _base = ''.
|
|---|
| 5 | const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : '';
|
|---|
| 6 | %>
|
|---|
| 7 | <article class="container post-page">
|
|---|
| 8 |
|
|---|
| 9 | <%# Navigation across ALL posts — ABOVE the post (shared partial). %>
|
|---|
| 10 | <%- include('../partials/post-nav', { newerPost: newerPost, olderPost: olderPost }) %>
|
|---|
| 11 |
|
|---|
| 12 | <% if (post.cover_image_url) { %>
|
|---|
| 13 | <figure class="post-cover">
|
|---|
| 14 | <img src="<%= post.cover_image_url %>" alt="">
|
|---|
| 15 | </figure>
|
|---|
| 16 | <% } %>
|
|---|
| 17 |
|
|---|
| 18 | <header class="post-header">
|
|---|
| 19 | <h1 class="post-title"><%= post.title %></h1>
|
|---|
| 20 | <div class="post-meta">
|
|---|
| 21 | <a class="author" href="/users/<%= encodeURIComponent(post.author_username) %>"
|
|---|
| 22 | hx-get="/users/<%= encodeURIComponent(post.author_username) %>?partial=1"
|
|---|
| 23 | hx-target="#pcms-main" hx-swap="innerHTML"
|
|---|
| 24 | hx-push-url="/users/<%= encodeURIComponent(post.author_username) %>"
|
|---|
| 25 | hx-indicator="#pcms-loading"><%= post.author_username %></a>
|
|---|
| 26 | <span class="meta-sep">·</span>
|
|---|
| 27 | <time datetime="<%= post.published_at || post.created_at %>"><%= formatDate(post.published_at || post.created_at) %></time>
|
|---|
| 28 | <% if (post.status !== 'published') { %>
|
|---|
| 29 | <span class="meta-sep">·</span>
|
|---|
| 30 | <span class="status-badge status-<%= post.status %>"><%= post.status %></span>
|
|---|
| 31 | <% } %>
|
|---|
| 32 | </div>
|
|---|
| 33 | <% if (post.status === 'published') { %>
|
|---|
| 34 | <div class="post-like-row">
|
|---|
| 35 | <%- include('../partials/like-button', { post: post, likedByMe: (typeof likedByMe !== 'undefined' && likedByMe), likeCount: (typeof likeCount !== 'undefined' ? likeCount : 0), loggedIn: !!user, loginNext: _base + '/' + post.slug }) %>
|
|---|
| 36 | </div>
|
|---|
| 37 | <% } %>
|
|---|
| 38 | </header>
|
|---|
| 39 |
|
|---|
| 40 | <div class="post-content">
|
|---|
| 41 | <%- post.content_html %>
|
|---|
| 42 | </div>
|
|---|
| 43 |
|
|---|
| 44 | <% if (post.tags && post.tags.length > 0) { %>
|
|---|
| 45 | <div class="post-tags">
|
|---|
| 46 | <% post.tags.forEach(t => { %>
|
|---|
| 47 | <a class="tag" href="<%= _base %>/tag/<%= encodeURIComponent(t) %>"
|
|---|
| 48 | hx-get="<%= _base %>/tag/<%= encodeURIComponent(t) %>?partial=1"
|
|---|
| 49 | hx-target="#pcms-main" hx-swap="innerHTML"
|
|---|
| 50 | hx-push-url="<%= _base %>/tag/<%= encodeURIComponent(t) %>"
|
|---|
| 51 | hx-indicator="#pcms-loading">#<%= t %></a>
|
|---|
| 52 | <% }); %>
|
|---|
| 53 | </div>
|
|---|
| 54 | <% } %>
|
|---|
| 55 |
|
|---|
| 56 | <!-- Inline admin actions: only visible if user has permission -->
|
|---|
| 57 | <% if (user && (permissions.canEditPost(user, post, site) || permissions.canDeletePost(user, post, site))) { %>
|
|---|
| 58 | <aside class="post-actions">
|
|---|
| 59 | <% if (permissions.canEditPost(user, post, site)) { %>
|
|---|
| 60 | <a href="<%= _base %>/posts/<%= post.slug %>/edit" class="btn"
|
|---|
| 61 | hx-get="<%= _base %>/posts/<%= post.slug %>/edit?partial=1" hx-target="#pcms-main"
|
|---|
| 62 | hx-push-url="<%= _base %>/posts/<%= post.slug %>/edit" hx-indicator="#pcms-loading">
|
|---|
| 63 | ✏️ Edit
|
|---|
| 64 | </a>
|
|---|
| 65 | <% } %>
|
|---|
| 66 | <% if (permissions.canDeletePost(user, post, site)) { %>
|
|---|
| 67 | <form method="post" action="<%= _base %>/posts/<%= post.slug %>/delete" style="display:inline" onsubmit="return confirm('Delete this post?')">
|
|---|
| 68 | <button type="submit" class="btn btn-danger">🗑 Delete</button>
|
|---|
| 69 | </form>
|
|---|
| 70 | <% } %>
|
|---|
| 71 | </aside>
|
|---|
| 72 | <% } %>
|
|---|
| 73 |
|
|---|
| 74 | <!-- Fediverse interactions (inbound replies / likes / boosts via ActivityPub) -->
|
|---|
| 75 | <!-- Mirrors the native comment markup/classes so it looks identical. -->
|
|---|
| 76 | <% if (typeof fediverse !== 'undefined' && fediverse && fediverse.total > 0) { %>
|
|---|
| 77 | <section class="post-fediverse post-comments" id="fediverse">
|
|---|
| 78 | <h2 class="comments-heading"><%= t('fedi.heading') %></h2>
|
|---|
| 79 | <p class="fedi-stats">
|
|---|
| 80 | <span title="<%= t('fedi.likes') %>">⭐ <%= fediverse.likeCount %></span>
|
|---|
| 81 | <span title="<%= t('fedi.boosts') %>">🔁 <%= fediverse.announceCount %></span>
|
|---|
| 82 | <span title="<%= t('fedi.replies') %>">💬 <%= fediverse.replies.length %></span>
|
|---|
| 83 | </p>
|
|---|
| 84 | <% if (fediverse.replies.length) { %>
|
|---|
| 85 | <ol class="comments-list">
|
|---|
| 86 | <% fediverse.replies.forEach(function(r) { %>
|
|---|
| 87 | <li class="comment">
|
|---|
| 88 | <div class="comment-avatar">
|
|---|
| 89 | <% if (r.actor_icon) { %><img src="<%= r.actor_icon %>" alt="" loading="lazy">
|
|---|
| 90 | <% } else { %><span><%= (r.actor_name || '?').charAt(0).toUpperCase() %></span><% } %>
|
|---|
| 91 | </div>
|
|---|
| 92 | <div class="comment-body">
|
|---|
| 93 | <div class="comment-meta">
|
|---|
| 94 | <a class="comment-author" href="<%= r.actor_url %>" rel="nofollow noopener" target="_blank"><%= r.actor_name %></a>
|
|---|
| 95 | <span class="fedi-handle"><%= r.actor_handle %></span>
|
|---|
| 96 | <% if (r.published || r.created_at) { %><span class="comment-time"><%= formatDateTime(r.published || r.created_at) %></span><% } %>
|
|---|
| 97 | </div>
|
|---|
| 98 | <div class="comment-content"><%- r.content %></div>
|
|---|
| 99 |
|
|---|
| 100 | <% if (typeof canManageSite !== 'undefined' && canManageSite) { %>
|
|---|
| 101 | <details class="fedi-replybox">
|
|---|
| 102 | <summary class="comment-reply-btn fedi-reply-toggle"><%= t('fedi.reply') %></summary>
|
|---|
| 103 | <form method="post" action="<%= _base %>/posts/<%= post.slug %>/fedi-reply" class="comment-reply-form">
|
|---|
| 104 | <input type="hidden" name="interaction_id" value="<%= r.id %>">
|
|---|
| 105 | <textarea name="text" rows="3" required placeholder="<%= t('fedi.reply_ph') %>"></textarea>
|
|---|
| 106 | <div class="comment-reply-form-actions">
|
|---|
| 107 | <button type="submit" class="btn btn-primary"><%= t('fedi.send') %></button>
|
|---|
| 108 | </div>
|
|---|
| 109 | </form>
|
|---|
| 110 | </details>
|
|---|
| 111 | <% } %>
|
|---|
| 112 |
|
|---|
| 113 | <% var mine = (typeof fediverse.outReplies !== 'undefined' ? fediverse.outReplies : []).filter(function(o){ return o.in_reply_to && o.in_reply_to === r.object_uri; }); %>
|
|---|
| 114 | <% if (mine.length) { %>
|
|---|
| 115 | <ol class="comment-replies">
|
|---|
| 116 | <% mine.forEach(function(o){ %>
|
|---|
| 117 | <li class="comment comment-reply">
|
|---|
| 118 | <div class="comment-avatar">
|
|---|
| 119 | <% if (typeof siteAvatar !== 'undefined' && siteAvatar) { %><img src="<%= siteAvatar %>" alt="">
|
|---|
| 120 | <% } else { %><span><%= t('fedi.you').charAt(0).toUpperCase() %></span><% } %>
|
|---|
| 121 | </div>
|
|---|
| 122 | <div class="comment-body">
|
|---|
| 123 | <div class="comment-meta"><span class="comment-author"><%= t('fedi.you') %></span></div>
|
|---|
| 124 | <div class="comment-content"><%- o.content %></div>
|
|---|
| 125 | </div>
|
|---|
| 126 | </li>
|
|---|
| 127 | <% }); %>
|
|---|
| 128 | </ol>
|
|---|
| 129 | <% } %>
|
|---|
| 130 | </div>
|
|---|
| 131 | </li>
|
|---|
| 132 | <% }); %>
|
|---|
| 133 | </ol>
|
|---|
| 134 | <% } %>
|
|---|
| 135 | </section>
|
|---|
| 136 | <% } %>
|
|---|
| 137 |
|
|---|
| 138 | <!-- Comments -->
|
|---|
| 139 | <section class="post-comments" id="comments">
|
|---|
| 140 | <h2 class="comments-heading">
|
|---|
| 141 | <%= t(totalComments === 1 ? 'comments.heading_one' : 'comments.heading_other', { n: totalComments }) %>
|
|---|
| 142 | </h2>
|
|---|
| 143 |
|
|---|
| 144 | <% if (typeof currentPath === 'string' && currentPath && currentPath.indexOf('/' + post.slug) === 0) { %>
|
|---|
| 145 | <% /* If the URL has ?pending=1, the previous submit landed in the moderation queue */ %>
|
|---|
| 146 | <% } %>
|
|---|
| 147 | <script>
|
|---|
| 148 | (function() {
|
|---|
| 149 | if (location.search.indexOf('pending=1') !== -1) {
|
|---|
| 150 | var s = document.createElement('div');
|
|---|
| 151 | s.className = 'comments-pending-flash';
|
|---|
| 152 | s.textContent = <%- JSON.stringify(t('comments.pending')) %>;
|
|---|
| 153 | document.currentScript.parentNode.insertBefore(s, document.currentScript);
|
|---|
| 154 | }
|
|---|
| 155 | })();
|
|---|
| 156 | </script>
|
|---|
| 157 |
|
|---|
| 158 | <% if (!comments || !comments.length) { %>
|
|---|
| 159 | <p class="comments-empty"><%= t('comments.empty') %><% if (!user) { %> <a href="/auth/login?next=<%= encodeURIComponent(_base + '/' + post.slug + '#comments') %>"><%= t('nav.login') %></a> <%= t('comments.to_start') %><% } %></p>
|
|---|
| 160 | <% } else { %>
|
|---|
| 161 | <ol class="comments-list">
|
|---|
| 162 | <% comments.forEach(function(c) { %>
|
|---|
| 163 | <li class="comment" id="comment-<%= c.id %>">
|
|---|
| 164 | <div class="comment-avatar">
|
|---|
| 165 | <% if (c.author_avatar) { %>
|
|---|
| 166 | <img src="<%= c.author_avatar %>" alt="">
|
|---|
| 167 | <% } else { %>
|
|---|
| 168 | <span><%= c.author_username.charAt(0).toUpperCase() %></span>
|
|---|
| 169 | <% } %>
|
|---|
| 170 | </div>
|
|---|
| 171 | <div class="comment-body">
|
|---|
| 172 | <div class="comment-meta">
|
|---|
| 173 | <a class="comment-author" href="/users/<%= encodeURIComponent(c.author_username) %>"><%= c.author_username %></a>
|
|---|
| 174 | <span class="comment-time" title="<%= c.created_at %>"><%= formatDateTime(c.created_at) %></span>
|
|---|
| 175 | </div>
|
|---|
| 176 | <div class="comment-content"><%= c.content %></div>
|
|---|
| 177 | <div class="comment-actions">
|
|---|
| 178 | <% if (user && canMutate) { %>
|
|---|
| 179 | <button type="button" class="comment-reply-btn" data-reply-to="<%= c.id %>"><%= t('comments.reply') %></button>
|
|---|
| 180 | <% } %>
|
|---|
| 181 | <% if (user && permissions.canDeleteComment(user, c, site)) { %>
|
|---|
| 182 | <form method="post" action="<%= _base %>/comments/<%= c.id %>/delete" onsubmit="return confirm('<%= t('comments.delete_confirm') %>')">
|
|---|
| 183 | <button type="submit" class="comment-delete-btn"><%= t('comments.delete') %></button>
|
|---|
| 184 | </form>
|
|---|
| 185 | <% } %>
|
|---|
| 186 | </div>
|
|---|
| 187 |
|
|---|
| 188 | <!-- Inline reply form (hidden by default) -->
|
|---|
| 189 | <% if (user && canMutate) { %>
|
|---|
| 190 | <form method="post" action="<%= _base %>/comments" class="comment-reply-form" hidden data-reply-form-for="<%= c.id %>">
|
|---|
| 191 | <input type="hidden" name="post_slug" value="<%= post.slug %>">
|
|---|
| 192 | <input type="hidden" name="parent_comment_id" value="<%= c.id %>">
|
|---|
| 193 | <textarea name="content" rows="3" maxlength="4000" placeholder="<%= t('comments.reply_to', { name: c.author_username }) %>" required></textarea>
|
|---|
| 194 | <div class="comment-reply-form-actions">
|
|---|
| 195 | <button type="submit" class="btn btn-primary"><%= t('comments.reply') %></button>
|
|---|
| 196 | <button type="button" class="btn comment-cancel-reply"><%= t('comments.cancel') %></button>
|
|---|
| 197 | </div>
|
|---|
| 198 | </form>
|
|---|
| 199 | <% } %>
|
|---|
| 200 |
|
|---|
| 201 | <!-- Replies (1 level deep) -->
|
|---|
| 202 | <% if (c.replies && c.replies.length) { %>
|
|---|
| 203 | <ol class="comment-replies">
|
|---|
| 204 | <% c.replies.forEach(function(r) { %>
|
|---|
| 205 | <li class="comment comment-reply" id="comment-<%= r.id %>">
|
|---|
| 206 | <div class="comment-avatar">
|
|---|
| 207 | <% if (r.author_avatar) { %>
|
|---|
| 208 | <img src="<%= r.author_avatar %>" alt="">
|
|---|
| 209 | <% } else { %>
|
|---|
| 210 | <span><%= r.author_username.charAt(0).toUpperCase() %></span>
|
|---|
| 211 | <% } %>
|
|---|
| 212 | </div>
|
|---|
| 213 | <div class="comment-body">
|
|---|
| 214 | <div class="comment-meta">
|
|---|
| 215 | <a class="comment-author" href="/users/<%= encodeURIComponent(r.author_username) %>"><%= r.author_username %></a>
|
|---|
| 216 | <span class="comment-time"><%= formatDateTime(r.created_at) %></span>
|
|---|
| 217 | </div>
|
|---|
| 218 | <div class="comment-content"><%= r.content %></div>
|
|---|
| 219 | <div class="comment-actions">
|
|---|
| 220 | <% if (user && canMutate) { %>
|
|---|
| 221 | <button type="button" class="comment-reply-btn" data-reply-to="<%= r.id %>"><%= t('comments.reply') %></button>
|
|---|
| 222 | <% } %>
|
|---|
| 223 | <% if (user && permissions.canDeleteComment(user, r, site)) { %>
|
|---|
| 224 | <form method="post" action="<%= _base %>/comments/<%= r.id %>/delete" onsubmit="return confirm('<%= t('comments.delete_confirm') %>')">
|
|---|
| 225 | <button type="submit" class="comment-delete-btn"><%= t('comments.delete') %></button>
|
|---|
| 226 | </form>
|
|---|
| 227 | <% } %>
|
|---|
| 228 | </div>
|
|---|
| 229 |
|
|---|
| 230 | <%# Replying to a reply — lands (via resolvedParent on the
|
|---|
| 231 | server) in the same thread, so the 1-level depth is preserved. %>
|
|---|
| 232 | <% if (user && canMutate) { %>
|
|---|
| 233 | <form method="post" action="<%= _base %>/comments" class="comment-reply-form" hidden data-reply-form-for="<%= r.id %>">
|
|---|
| 234 | <input type="hidden" name="post_slug" value="<%= post.slug %>">
|
|---|
| 235 | <input type="hidden" name="parent_comment_id" value="<%= r.id %>">
|
|---|
| 236 | <textarea name="content" rows="3" maxlength="4000" placeholder="<%= t('comments.reply_to', { name: r.author_username }) %>" required></textarea>
|
|---|
| 237 | <div class="comment-reply-form-actions">
|
|---|
| 238 | <button type="submit" class="btn btn-primary"><%= t('comments.reply') %></button>
|
|---|
| 239 | <button type="button" class="btn comment-cancel-reply"><%= t('comments.cancel') %></button>
|
|---|
| 240 | </div>
|
|---|
| 241 | </form>
|
|---|
| 242 | <% } %>
|
|---|
| 243 | </div>
|
|---|
| 244 | </li>
|
|---|
| 245 | <% }); %>
|
|---|
| 246 | </ol>
|
|---|
| 247 | <% } %>
|
|---|
| 248 | </div>
|
|---|
| 249 | </li>
|
|---|
| 250 | <% }); %>
|
|---|
| 251 | </ol>
|
|---|
| 252 | <% } %>
|
|---|
| 253 |
|
|---|
| 254 | <!-- Top-level comment form (only for logged-in users for now) -->
|
|---|
| 255 | <% if (user && canMutate) { %>
|
|---|
| 256 | <form method="post" action="<%= _base %>/comments" class="comment-form">
|
|---|
| 257 | <input type="hidden" name="post_slug" value="<%= post.slug %>">
|
|---|
| 258 | <label class="comment-form-label">
|
|---|
| 259 | <span><%= t('comments.add_as') %> <strong><%= user.username %></strong></span>
|
|---|
| 260 | <textarea name="content" rows="3" maxlength="4000" placeholder="<%= t('comments.placeholder') %>" required></textarea>
|
|---|
| 261 | </label>
|
|---|
| 262 | <button type="submit" class="btn btn-primary"><%= t('comments.post') %></button>
|
|---|
| 263 | </form>
|
|---|
| 264 | <% } else if (!user) { %>
|
|---|
| 265 | <p class="comments-login-cta">
|
|---|
| 266 | <a href="/auth/login?next=<%= encodeURIComponent(_base + '/' + post.slug + '#comments') %>" class="btn"><%= t('comments.login_to_comment') %></a>
|
|---|
| 267 | </p>
|
|---|
| 268 | <% } else { %>
|
|---|
| 269 | <p class="comments-login-cta" style="color:var(--ink-muted)">👁️ Kijker-modus — reageren is uitgeschakeld.</p>
|
|---|
| 270 | <% } %>
|
|---|
| 271 | </section>
|
|---|
| 272 |
|
|---|
| 273 | <!-- Reply form toggle -->
|
|---|
| 274 | <script>
|
|---|
| 275 | (function() {
|
|---|
| 276 | document.querySelectorAll('.comment-reply-btn').forEach(function(btn) {
|
|---|
| 277 | btn.addEventListener('click', function() {
|
|---|
| 278 | var id = btn.dataset.replyTo;
|
|---|
| 279 | var form = document.querySelector('[data-reply-form-for="' + id + '"]');
|
|---|
| 280 | if (form) {
|
|---|
| 281 | form.hidden = !form.hidden;
|
|---|
| 282 | if (!form.hidden) form.querySelector('textarea').focus();
|
|---|
| 283 | }
|
|---|
| 284 | });
|
|---|
| 285 | });
|
|---|
| 286 | document.querySelectorAll('.comment-cancel-reply').forEach(function(btn) {
|
|---|
| 287 | btn.addEventListener('click', function() {
|
|---|
| 288 | btn.closest('.comment-reply-form').hidden = true;
|
|---|
| 289 | });
|
|---|
| 290 | });
|
|---|
| 291 | })();
|
|---|
| 292 | </script>
|
|---|
| 293 |
|
|---|
| 294 | <%# ── Related posts (3-card grid) ─────────────────────────────
|
|---|
| 295 | Always shown if at least one related post exists. Selection logic
|
|---|
| 296 | lives server-side: same-tag posts ranked by overlap, falling back
|
|---|
| 297 | to most-recent if there's no tag overlap. %>
|
|---|
| 298 | <% if (relatedPosts && relatedPosts.length > 0) { %>
|
|---|
| 299 | <section class="post-related" aria-labelledby="related-heading">
|
|---|
| 300 | <h2 class="post-related-heading" id="related-heading"><%= t('related.title') %></h2>
|
|---|
| 301 | <ul class="post-related-grid">
|
|---|
| 302 | <% relatedPosts.forEach(function(rp) { %>
|
|---|
| 303 | <li class="post-related-card">
|
|---|
| 304 | <a href="<%= rp._urlBase || '' %>/<%= rp.slug %>"<% if (!rp._urlBase) { %>
|
|---|
| 305 | hx-get="/<%= rp.slug %>?partial=1" hx-target="#pcms-main"
|
|---|
| 306 | hx-push-url="/<%= rp.slug %>" hx-indicator="#pcms-loading"<% } %>>
|
|---|
| 307 | <% if (rp.cover_image_url) { %>
|
|---|
| 308 | <span class="post-related-cover"
|
|---|
| 309 | style="background-image: url('<%= rp.cover_image_url %>')"
|
|---|
| 310 | aria-hidden="true"></span>
|
|---|
| 311 | <% } else { %>
|
|---|
| 312 | <span class="post-related-cover post-related-cover--empty" aria-hidden="true"></span>
|
|---|
| 313 | <% } %>
|
|---|
| 314 | <span class="post-related-meta">
|
|---|
| 315 | <span class="post-related-date"><%= formatDate(rp.published_at) %></span>
|
|---|
| 316 | <span class="post-related-title"><%= rp.title %></span>
|
|---|
| 317 | </span>
|
|---|
| 318 | </a>
|
|---|
| 319 | </li>
|
|---|
| 320 | <% }); %>
|
|---|
| 321 | </ul>
|
|---|
| 322 | </section>
|
|---|
| 323 | <% } %>
|
|---|
| 324 |
|
|---|
| 325 | </article>
|
|---|
| 326 | <style>
|
|---|
| 327 | .post-page { max-width: 720px; margin: 0.5rem auto 2rem; padding: 0 1rem; }
|
|---|
| 328 | .post-cover { margin: 0 0 2rem; border-radius: 8px; overflow: hidden; }
|
|---|
| 329 | .post-cover img { width: 100%; height: auto; display: block; }
|
|---|
| 330 | .post-header { margin-bottom: 2rem; }
|
|---|
| 331 | .post-title { font-family: var(--font-display, serif); font-size: 2.5rem; line-height: 1.1; margin: 0 0 1rem; }
|
|---|
| 332 | @media (max-width: 600px) { .post-title { font-size: 1.85rem; } }
|
|---|
| 333 | .post-meta { font-size: 0.9rem; color: var(--ink-muted); }
|
|---|
| 334 | .author { font-weight: 500; color: var(--ink-soft); text-decoration: none; }
|
|---|
| 335 | .author:hover { color: var(--accent); }
|
|---|
| 336 | .post-content { font-family: var(--font-body, serif); font-size: 1.1rem; line-height: 1.7; color: var(--ink); }
|
|---|
| 337 | .post-content p { margin: 1.2em 0; }
|
|---|
| 338 | .post-like-row { margin-top: 1rem; }
|
|---|
| 339 | .like-btn {
|
|---|
| 340 | display: inline-flex; align-items: center; gap: 0.45rem;
|
|---|
| 341 | padding: 0.4rem 0.85rem; border: 1px solid var(--rule); border-radius: 999px;
|
|---|
| 342 | background: var(--paper-2); color: var(--ink); font: inherit; font-size: 0.95rem;
|
|---|
| 343 | cursor: pointer; text-decoration: none; transition: border-color 120ms, color 120ms, background 120ms;
|
|---|
| 344 | }
|
|---|
| 345 | .like-btn:hover { border-color: var(--accent); }
|
|---|
| 346 | .like-btn .like-heart { font-size: 1.1rem; line-height: 1; }
|
|---|
| 347 | .like-btn.is-liked { border-color: var(--accent); color: var(--accent); }
|
|---|
| 348 | .like-btn.is-liked .like-heart { color: var(--accent); }
|
|---|
| 349 | .like-btn .like-count { font-variant-numeric: tabular-nums; }
|
|---|
| 350 | .post-content h2 { font-family: var(--font-display, serif); font-size: 1.6rem; margin: 2rem 0 1rem; }
|
|---|
| 351 | .post-content h3 { font-family: var(--font-display, serif); font-size: 1.3rem; margin: 1.5rem 0 0.75rem; }
|
|---|
| 352 | .post-content a { color: var(--accent); }
|
|---|
| 353 | .post-content code { background: var(--paper-2); padding: 0.1em 0.4em; border-radius: 3px; font-family: var(--font-mono, monospace); font-size: 0.9em; }
|
|---|
| 354 | .post-content pre { background: var(--paper-2); padding: 1rem; border-radius: 6px; overflow-x: auto; }
|
|---|
| 355 | .post-content blockquote { border-left: 3px solid var(--accent); padding-left: 1rem; margin: 1.5rem 0; color: var(--ink-soft); font-style: italic; }
|
|---|
| 356 | .post-content img { max-width: 100%; height: auto; border-radius: 6px; }
|
|---|
| 357 | .post-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 2rem 0; }
|
|---|
| 358 | .tag { background: var(--paper-2); color: var(--ink-soft); padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.85rem; text-decoration: none; transition: background 120ms, color 120ms; }
|
|---|
| 359 | .tag:hover { background: var(--accent); color: white; }
|
|---|
| 360 | .post-actions { display: flex; gap: 0.5rem; margin: 2rem 0; padding: 1rem; background: var(--paper-2); border-radius: 6px; flex-wrap: wrap; }
|
|---|
| 361 |
|
|---|
| 362 | /* ============================================================
|
|---|
| 363 | Comments
|
|---|
| 364 | ============================================================ */
|
|---|
| 365 | .post-comments {
|
|---|
| 366 | margin-top: 3rem;
|
|---|
| 367 | padding-top: 2rem;
|
|---|
| 368 | border-top: 1px solid var(--rule);
|
|---|
| 369 | }
|
|---|
| 370 | .comments-heading {
|
|---|
| 371 | font-family: var(--font-display, serif);
|
|---|
| 372 | font-size: 1.5rem;
|
|---|
| 373 | margin: 0 0 1.5rem;
|
|---|
| 374 | }
|
|---|
| 375 | .comments-empty { color: var(--ink-muted, var(--ink-soft)); margin: 0 0 1.5rem; }
|
|---|
| 376 | .comments-pending-flash {
|
|---|
| 377 | background: rgba(40, 160, 90, 0.15);
|
|---|
| 378 | color: #2a9d5e;
|
|---|
| 379 | border: 1px solid rgba(40, 160, 90, 0.3);
|
|---|
| 380 | padding: 0.75rem 1rem;
|
|---|
| 381 | border-radius: 6px;
|
|---|
| 382 | margin-bottom: 1rem;
|
|---|
| 383 | font-size: 0.9rem;
|
|---|
| 384 | }
|
|---|
| 385 | .comments-empty a { color: var(--accent); }
|
|---|
| 386 |
|
|---|
| 387 | .comments-list, .comment-replies {
|
|---|
| 388 | list-style: none;
|
|---|
| 389 | padding: 0;
|
|---|
| 390 | margin: 0 0 2rem;
|
|---|
| 391 | }
|
|---|
| 392 |
|
|---|
| 393 | .comment {
|
|---|
| 394 | display: flex;
|
|---|
| 395 | gap: 0.85rem;
|
|---|
| 396 | padding: 1rem 0;
|
|---|
| 397 | border-top: 1px solid var(--rule);
|
|---|
| 398 | }
|
|---|
| 399 | .comments-list > .comment:first-child { border-top: 0; padding-top: 0; }
|
|---|
| 400 |
|
|---|
| 401 | .comment-avatar {
|
|---|
| 402 | flex-shrink: 0;
|
|---|
| 403 | width: 40px;
|
|---|
| 404 | height: 40px;
|
|---|
| 405 | border-radius: 50%;
|
|---|
| 406 | background: var(--paper-2);
|
|---|
| 407 | border: 1px solid var(--rule);
|
|---|
| 408 | overflow: hidden;
|
|---|
| 409 | display: inline-flex;
|
|---|
| 410 | align-items: center;
|
|---|
| 411 | justify-content: center;
|
|---|
| 412 | }
|
|---|
| 413 | .comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
|
|---|
| 414 | .comment-avatar span {
|
|---|
| 415 | font-family: var(--font-display, serif);
|
|---|
| 416 | font-weight: 700;
|
|---|
| 417 | color: var(--accent);
|
|---|
| 418 | }
|
|---|
| 419 |
|
|---|
| 420 | .comment-body { flex: 1; min-width: 0; }
|
|---|
| 421 | .comment-meta {
|
|---|
| 422 | display: flex;
|
|---|
| 423 | gap: 0.5rem;
|
|---|
| 424 | align-items: baseline;
|
|---|
| 425 | font-size: 0.85rem;
|
|---|
| 426 | margin-bottom: 0.3rem;
|
|---|
| 427 | }
|
|---|
| 428 | .comment-author { color: var(--ink); font-weight: 600; text-decoration: none; }
|
|---|
| 429 | .comment-author:hover { color: var(--accent); }
|
|---|
| 430 | .comment-time { color: var(--ink-muted, var(--ink-soft)); }
|
|---|
| 431 | .comment-content {
|
|---|
| 432 | white-space: pre-wrap;
|
|---|
| 433 | word-wrap: break-word;
|
|---|
| 434 | color: var(--ink);
|
|---|
| 435 | line-height: 1.5;
|
|---|
| 436 | font-size: 0.95rem;
|
|---|
| 437 | }
|
|---|
| 438 |
|
|---|
| 439 | .comment-actions {
|
|---|
| 440 | display: flex;
|
|---|
| 441 | gap: 0.5rem;
|
|---|
| 442 | margin-top: 0.4rem;
|
|---|
| 443 | }
|
|---|
| 444 | .comment-reply-btn, .comment-delete-btn {
|
|---|
| 445 | background: none;
|
|---|
| 446 | border: 0;
|
|---|
| 447 | color: var(--ink-muted, var(--ink-soft));
|
|---|
| 448 | font-size: 0.8rem;
|
|---|
| 449 | cursor: pointer;
|
|---|
| 450 | padding: 0.2rem 0;
|
|---|
| 451 | font-family: inherit;
|
|---|
| 452 | text-transform: uppercase;
|
|---|
| 453 | letter-spacing: 0.04em;
|
|---|
| 454 | }
|
|---|
| 455 | .comment-reply-btn:hover { color: var(--accent); }
|
|---|
| 456 | .comment-delete-btn:hover { color: #c33; }
|
|---|
| 457 |
|
|---|
| 458 | .comment-replies {
|
|---|
| 459 | margin-top: 1rem;
|
|---|
| 460 | margin-left: 0;
|
|---|
| 461 | border-left: 2px solid var(--rule);
|
|---|
| 462 | padding-left: 1rem;
|
|---|
| 463 | }
|
|---|
| 464 | .comment-reply { padding: 0.75rem 0; }
|
|---|
| 465 | .comment-replies > .comment-reply:first-child { border-top: 0; padding-top: 0; }
|
|---|
| 466 | .comment-reply .comment-avatar { width: 32px; height: 32px; }
|
|---|
| 467 | .comment-reply .comment-avatar span { font-size: 0.85rem; }
|
|---|
| 468 |
|
|---|
| 469 | .comment-form, .comment-reply-form {
|
|---|
| 470 | display: flex;
|
|---|
| 471 | flex-direction: column;
|
|---|
| 472 | gap: 0.6rem;
|
|---|
| 473 | background: var(--paper-2);
|
|---|
| 474 | border: 1px solid var(--rule);
|
|---|
| 475 | border-radius: 8px;
|
|---|
| 476 | padding: 1rem;
|
|---|
| 477 | margin-top: 1rem;
|
|---|
| 478 | }
|
|---|
| 479 | .comment-form-label { display: flex; flex-direction: column; gap: 0.4rem; }
|
|---|
| 480 | .comment-form-label > span { font-size: 0.85rem; color: var(--ink-muted, var(--ink-soft)); }
|
|---|
| 481 | .comment-form textarea, .comment-reply-form textarea {
|
|---|
| 482 | width: 100%;
|
|---|
| 483 | resize: vertical;
|
|---|
| 484 | min-height: 70px;
|
|---|
| 485 | padding: 0.65rem 0.85rem;
|
|---|
| 486 | border: 1px solid var(--rule);
|
|---|
| 487 | border-radius: 5px;
|
|---|
| 488 | background: var(--paper);
|
|---|
| 489 | color: var(--ink);
|
|---|
| 490 | font-family: inherit;
|
|---|
| 491 | font-size: 0.95rem;
|
|---|
| 492 | line-height: 1.4;
|
|---|
| 493 | box-sizing: border-box;
|
|---|
| 494 | }
|
|---|
| 495 | .comment-form button { align-self: flex-start; }
|
|---|
| 496 | .comment-reply-form-actions { display: flex; gap: 0.5rem; }
|
|---|
| 497 | /* Show the reply form only AFTER clicking REPLY. The display:flex above would
|
|---|
| 498 | otherwise override the [hidden] attribute → form was always open. */
|
|---|
| 499 | .comment-reply-form[hidden] { display: none; }
|
|---|
| 500 | /* DELETE button is inside a <form>; display:contents makes it a direct flex-sibling
|
|---|
| 501 | of REPLY → pixel-perfect alignment + equal gap. */
|
|---|
| 502 | .comment-actions form { display: contents; }
|
|---|
| 503 |
|
|---|
| 504 | .comments-login-cta { margin-top: 1.5rem; text-align: center; }
|
|---|
| 505 |
|
|---|
| 506 | /* ─── Related posts (3-card grid above pinned-nav) ─────────────── */
|
|---|
| 507 | .post-related {
|
|---|
| 508 | margin: 3rem auto 1.5rem;
|
|---|
| 509 | /* Break out of the 720px article column so the cards have room to breathe.
|
|---|
| 510 | Cap at 1100 to match other wide content. */
|
|---|
| 511 | max-width: 1100px;
|
|---|
| 512 | padding: 0 1rem;
|
|---|
| 513 | }
|
|---|
| 514 | .post-related-heading {
|
|---|
| 515 | font-family: var(--font-ui, system-ui), sans-serif;
|
|---|
| 516 | font-size: 0.75rem;
|
|---|
| 517 | font-weight: 600;
|
|---|
| 518 | text-transform: uppercase;
|
|---|
| 519 | letter-spacing: 0.15em;
|
|---|
| 520 | color: var(--ink-muted, var(--ink-soft));
|
|---|
| 521 | margin: 0 0 1rem;
|
|---|
| 522 | }
|
|---|
| 523 | .post-related-grid {
|
|---|
| 524 | list-style: none;
|
|---|
| 525 | padding: 0; margin: 0;
|
|---|
| 526 | display: grid;
|
|---|
| 527 | grid-template-columns: repeat(3, minmax(0, 1fr));
|
|---|
| 528 | gap: 1rem;
|
|---|
| 529 | }
|
|---|
| 530 | @media (max-width: 880px) { .post-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
|---|
| 531 | @media (max-width: 540px) { .post-related-grid { grid-template-columns: 1fr; } }
|
|---|
| 532 |
|
|---|
| 533 | .post-related-card {
|
|---|
| 534 | background: var(--paper);
|
|---|
| 535 | border: 1px solid var(--rule);
|
|---|
| 536 | border-radius: 10px;
|
|---|
| 537 | overflow: hidden;
|
|---|
| 538 | transition: border-color 150ms, transform 150ms;
|
|---|
| 539 | }
|
|---|
| 540 | .post-related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
|
|---|
| 541 | .post-related-card a {
|
|---|
| 542 | display: block;
|
|---|
| 543 | color: inherit;
|
|---|
| 544 | text-decoration: none;
|
|---|
| 545 | }
|
|---|
| 546 | .post-related-cover {
|
|---|
| 547 | display: block;
|
|---|
| 548 | aspect-ratio: 16 / 10;
|
|---|
| 549 | background: var(--paper-2) center/cover no-repeat;
|
|---|
| 550 | }
|
|---|
| 551 | .post-related-cover--empty {
|
|---|
| 552 | background-image: linear-gradient(135deg,
|
|---|
| 553 | color-mix(in srgb, var(--accent) 12%, var(--paper-2)),
|
|---|
| 554 | var(--paper-2));
|
|---|
| 555 | }
|
|---|
| 556 | .post-related-meta {
|
|---|
| 557 | display: flex; flex-direction: column; gap: 0.4rem;
|
|---|
| 558 | padding: 0.85rem 1rem 1.1rem;
|
|---|
| 559 | }
|
|---|
| 560 | .post-related-date {
|
|---|
| 561 | font-size: 0.78rem;
|
|---|
| 562 | color: var(--ink-muted, var(--ink-soft));
|
|---|
| 563 | font-variant-numeric: tabular-nums;
|
|---|
| 564 | }
|
|---|
| 565 | .post-related-title {
|
|---|
| 566 | font-family: var(--font-display, serif);
|
|---|
| 567 | font-size: 1.1rem;
|
|---|
| 568 | font-weight: 600;
|
|---|
| 569 | color: var(--ink);
|
|---|
| 570 | line-height: 1.25;
|
|---|
| 571 | }
|
|---|
| 572 |
|
|---|
| 573 | /* ─── Pinned navigation cards (v9 style) ───────────────────────── */
|
|---|
| 574 | .post-pinned-nav {
|
|---|
| 575 | display: grid;
|
|---|
| 576 | grid-template-columns: 1fr 1fr;
|
|---|
| 577 | gap: 1rem;
|
|---|
| 578 | margin: 1.5rem auto 2rem;
|
|---|
| 579 | max-width: 1100px;
|
|---|
| 580 | padding: 0 1rem;
|
|---|
| 581 | }
|
|---|
| 582 | @media (max-width: 600px) {
|
|---|
| 583 | .post-pinned-nav { grid-template-columns: 1fr; }
|
|---|
| 584 | }
|
|---|
| 585 |
|
|---|
| 586 | .post-pinned-card {
|
|---|
| 587 | display: flex; align-items: center; gap: 1rem;
|
|---|
| 588 | padding: 1rem 1.25rem;
|
|---|
| 589 | border: 1.5px solid color-mix(in srgb, var(--accent) 50%, transparent);
|
|---|
| 590 | background: color-mix(in srgb, var(--accent) 6%, var(--paper));
|
|---|
| 591 | border-radius: 10px;
|
|---|
| 592 | text-decoration: none;
|
|---|
| 593 | color: var(--ink);
|
|---|
| 594 | transition: border-color 150ms, background 150ms, transform 150ms;
|
|---|
| 595 | min-height: 88px;
|
|---|
| 596 | }
|
|---|
| 597 | .post-pinned-card:hover {
|
|---|
| 598 | border-color: var(--accent);
|
|---|
| 599 | background: color-mix(in srgb, var(--accent) 11%, var(--paper));
|
|---|
| 600 | transform: translateY(-2px);
|
|---|
| 601 | }
|
|---|
| 602 | .post-pinned-arrow {
|
|---|
| 603 | font-size: 1.6rem;
|
|---|
| 604 | color: var(--accent);
|
|---|
| 605 | flex-shrink: 0;
|
|---|
| 606 | line-height: 1;
|
|---|
| 607 | }
|
|---|
| 608 | .post-pinned-card--next {
|
|---|
| 609 | /* "Volgende" card aligns text to the right with the arrow on the right
|
|---|
| 610 | side, mirroring v9 — the arrow is on the OPPOSITE end from the body. */
|
|---|
| 611 | flex-direction: row-reverse;
|
|---|
| 612 | text-align: right;
|
|---|
| 613 | }
|
|---|
| 614 | .post-pinned-body {
|
|---|
| 615 | display: flex; flex-direction: column; gap: 0.25rem;
|
|---|
| 616 | flex: 1; min-width: 0;
|
|---|
| 617 | }
|
|---|
| 618 | .post-pinned-label {
|
|---|
| 619 | font-family: var(--font-ui, system-ui), sans-serif;
|
|---|
| 620 | font-size: 0.7rem; font-weight: 600;
|
|---|
| 621 | text-transform: uppercase;
|
|---|
| 622 | letter-spacing: 0.1em;
|
|---|
| 623 | color: var(--accent);
|
|---|
| 624 | }
|
|---|
| 625 | .post-pinned-title {
|
|---|
| 626 | font-family: var(--font-display, serif);
|
|---|
| 627 | font-size: 1.05rem; font-weight: 600;
|
|---|
| 628 | color: var(--ink);
|
|---|
| 629 | line-height: 1.25;
|
|---|
| 630 | overflow: hidden;
|
|---|
| 631 | text-overflow: ellipsis;
|
|---|
| 632 | display: -webkit-box;
|
|---|
| 633 | -webkit-line-clamp: 2;
|
|---|
| 634 | -webkit-box-orient: vertical;
|
|---|
| 635 | }
|
|---|
| 636 | .post-pinned-cta {
|
|---|
| 637 | font-size: 0.78rem;
|
|---|
| 638 | color: var(--accent);
|
|---|
| 639 | font-weight: 500;
|
|---|
| 640 | }
|
|---|
| 641 |
|
|---|
| 642 | /* Edge-of-stack indicator: dashed border, muted styling. */
|
|---|
| 643 | .post-pinned-card--edge {
|
|---|
| 644 | flex-direction: column;
|
|---|
| 645 | align-items: flex-start;
|
|---|
| 646 | justify-content: center;
|
|---|
| 647 | gap: 0.35rem;
|
|---|
| 648 | border-style: dashed;
|
|---|
| 649 | background: transparent;
|
|---|
| 650 | color: var(--ink-muted, var(--ink-soft));
|
|---|
| 651 | cursor: default;
|
|---|
| 652 | }
|
|---|
| 653 | .post-pinned-card--edge:hover {
|
|---|
| 654 | /* Edge cards aren't clickable — undo the lift effect. */
|
|---|
| 655 | transform: none;
|
|---|
| 656 | border-color: color-mix(in srgb, var(--accent) 50%, transparent);
|
|---|
| 657 | background: transparent;
|
|---|
| 658 | }
|
|---|
| 659 | .post-pinned-edge-label {
|
|---|
| 660 | font-family: var(--font-ui, system-ui), sans-serif;
|
|---|
| 661 | font-size: 0.72rem;
|
|---|
| 662 | font-weight: 600;
|
|---|
| 663 | text-transform: uppercase;
|
|---|
| 664 | letter-spacing: 0.15em;
|
|---|
| 665 | color: var(--accent);
|
|---|
| 666 | }
|
|---|
| 667 | .post-pinned-edge-title {
|
|---|
| 668 | font-family: var(--font-display, serif);
|
|---|
| 669 | font-size: 1.05rem;
|
|---|
| 670 | font-weight: 600;
|
|---|
| 671 | color: var(--ink);
|
|---|
| 672 | }
|
|---|
| 673 | </style>
|
|---|