feat(corpus): make source links visible on search result cards

- a.passage-card__title now shows teal+underline (was ink/no-decoration, undetectable)
- adds "View source ↗" link below each passage excerpt when source_url present

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-18 16:16:04 +02:00
parent 2e2dfd7310
commit b495ff29fd
2 changed files with 19 additions and 2 deletions
+13
View File
@@ -3529,6 +3529,19 @@ a.dr-source-title-link:hover {
margin-bottom: 6px;
}
.passage-card__title:hover { color: var(--teal); text-decoration: underline; }
a.passage-card__title { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
a.passage-card__title:hover { color: var(--ink); }
.passage-source-link {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 0.76rem;
color: var(--muted);
text-decoration: none;
margin-top: 8px;
}
.passage-source-link:hover { color: var(--teal); text-decoration: underline; }
.passage-card__excerpt {
font-size: 0.82rem;
+6 -2
View File
@@ -796,8 +796,11 @@ require_once __DIR__ . '/includes/layout.php';
: `<span class="passage-card__title">${esc(hit.title || '(Untitled)')}</span>`;
const section = hit.section ? `<span class="passage-section">§ ${esc(hit.section)}</span>` : '';
const excerpt = highlight(hit.excerpt || '', q);
const fullText = (hit.full_text || '').trim();
const hasMore = fullText.length > (hit.excerpt || '').length;
const fullText = (hit.full_text || '').trim();
const hasMore = fullText.length > (hit.excerpt || '').length;
const sourceLink = hit.source_url
? `<a href="${esc(hit.source_url)}" target="_blank" rel="noopener" class="passage-source-link">View source ↗</a>`
: '';
const card = document.createElement('div');
card.className = 'passage-card';
@@ -809,6 +812,7 @@ require_once __DIR__ . '/includes/layout.php';
</div>
${titleHtml}
<p class="passage-card__excerpt">${excerpt}</p>
${sourceLink}
${hasMore ? '<button class="passage-expand-btn" type="button" aria-expanded="false">Show full passage</button><div class="passage-full-text" hidden></div>' : ''}`;
if (hasMore) {