| 1 | <div class="container tag-page">
|
|---|
| 2 | <header class="tag-page-header">
|
|---|
| 3 | <p class="tag-eyebrow">Tag</p>
|
|---|
| 4 | <h1>#<%= tag %></h1>
|
|---|
| 5 | <p class="tag-meta">
|
|---|
| 6 | <%= posts.length %> post<%= posts.length === 1 ? '' : 's' %>
|
|---|
| 7 | </p>
|
|---|
| 8 | </header>
|
|---|
| 9 |
|
|---|
| 10 | <% if (!posts.length) { %>
|
|---|
| 11 | <p class="tag-empty">No posts with this tag yet.</p>
|
|---|
| 12 | <% } else { %>
|
|---|
| 13 | <ol class="tag-results">
|
|---|
| 14 | <% posts.forEach(function(p) { %>
|
|---|
| 15 | <li class="tag-result">
|
|---|
| 16 | <% if (p.cover_image_url) { %>
|
|---|
| 17 | <a href="/<%= p.slug %>" class="tag-result-cover"
|
|---|
| 18 | hx-get="/<%= p.slug %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
|
|---|
| 19 | hx-push-url="/<%= p.slug %>" hx-indicator="#pcms-loading">
|
|---|
| 20 | <img src="<%= p.cover_image_url %>" alt="">
|
|---|
| 21 | </a>
|
|---|
| 22 | <% } %>
|
|---|
| 23 | <div class="tag-result-body">
|
|---|
| 24 | <h2 class="tag-result-title">
|
|---|
| 25 | <a href="/<%= p.slug %>"
|
|---|
| 26 | hx-get="/<%= p.slug %>?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"
|
|---|
| 27 | hx-push-url="/<%= p.slug %>" hx-indicator="#pcms-loading">
|
|---|
| 28 | <%= p.title || '(untitled)' %>
|
|---|
| 29 | </a>
|
|---|
| 30 | </h2>
|
|---|
| 31 | <p class="tag-result-meta">
|
|---|
| 32 | <%= p.author_username %><% if (p.published_at) { %> · <%= formatDate(p.published_at) %><% } %>
|
|---|
| 33 | </p>
|
|---|
| 34 | <% if (p.excerpt) { %>
|
|---|
| 35 | <p class="tag-result-excerpt"><%= p.excerpt %></p>
|
|---|
| 36 | <% } %>
|
|---|
| 37 | </div>
|
|---|
| 38 | </li>
|
|---|
| 39 | <% }); %>
|
|---|
| 40 | </ol>
|
|---|
| 41 | <% } %>
|
|---|
| 42 | </div>
|
|---|
| 43 |
|
|---|
| 44 | <style>
|
|---|
| 45 | .tag-page { max-width: 720px; margin: 3rem auto; padding: 0 1rem; }
|
|---|
| 46 | .tag-page-header { margin-bottom: 1.5rem; }
|
|---|
| 47 | .tag-eyebrow { color: var(--ink-muted, var(--ink-soft)); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0; }
|
|---|
| 48 | .tag-page h1 { font-family: var(--font-display, serif); font-size: 2.25rem; margin: 0.1rem 0 0.25rem; color: var(--accent); }
|
|---|
| 49 | .tag-meta { color: var(--ink-muted, var(--ink-soft)); font-size: 0.9rem; margin: 0; }
|
|---|
| 50 | .tag-empty { color: var(--ink-muted, var(--ink-soft)); text-align: center; margin: 3rem 0; }
|
|---|
| 51 |
|
|---|
| 52 | .tag-results { list-style: none; padding: 0; margin: 0; }
|
|---|
| 53 | .tag-result { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
|
|---|
| 54 | .tag-result:last-child { border-bottom: 0; }
|
|---|
| 55 | .tag-result-cover { flex-shrink: 0; width: 96px; height: 96px; border-radius: 6px; overflow: hidden; background: var(--paper-2); }
|
|---|
| 56 | .tag-result-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|---|
| 57 | .tag-result-body { flex: 1; min-width: 0; }
|
|---|
| 58 | .tag-result-title { font-family: var(--font-display, serif); font-size: 1.2rem; margin: 0 0 0.25rem; }
|
|---|
| 59 | .tag-result-title a { color: var(--ink); text-decoration: none; }
|
|---|
| 60 | .tag-result-title a:hover { color: var(--accent); }
|
|---|
| 61 | .tag-result-meta { color: var(--ink-muted, var(--ink-soft)); font-size: 0.85rem; margin: 0 0 0.4rem; }
|
|---|
| 62 | .tag-result-excerpt { color: var(--ink-soft); margin: 0; line-height: 1.5; }
|
|---|
| 63 |
|
|---|
| 64 | @media (max-width: 500px) {
|
|---|
| 65 | .tag-result-cover { width: 64px; height: 64px; }
|
|---|
| 66 | .tag-page h1 { font-size: 1.75rem; }
|
|---|
| 67 | }
|
|---|
| 68 | </style>
|
|---|