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:
+6
-2
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user