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; margin-bottom: 6px;
} }
.passage-card__title:hover { color: var(--teal); text-decoration: underline; } .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 { .passage-card__excerpt {
font-size: 0.82rem; font-size: 0.82rem;
+4
View File
@@ -798,6 +798,9 @@ require_once __DIR__ . '/includes/layout.php';
const excerpt = highlight(hit.excerpt || '', q); const excerpt = highlight(hit.excerpt || '', q);
const fullText = (hit.full_text || '').trim(); const fullText = (hit.full_text || '').trim();
const hasMore = fullText.length > (hit.excerpt || '').length; 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'); const card = document.createElement('div');
card.className = 'passage-card'; card.className = 'passage-card';
@@ -809,6 +812,7 @@ require_once __DIR__ . '/includes/layout.php';
</div> </div>
${titleHtml} ${titleHtml}
<p class="passage-card__excerpt">${excerpt}</p> <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>' : ''}`; ${hasMore ? '<button class="passage-expand-btn" type="button" aria-expanded="false">Show full passage</button><div class="passage-full-text" hidden></div>' : ''}`;
if (hasMore) { if (hasMore) {