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:
@@ -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;
|
||||||
|
|||||||
+6
-2
@@ -796,8 +796,11 @@ require_once __DIR__ . '/includes/layout.php';
|
|||||||
: `<span class="passage-card__title">${esc(hit.title || '(Untitled)')}</span>`;
|
: `<span class="passage-card__title">${esc(hit.title || '(Untitled)')}</span>`;
|
||||||
const section = hit.section ? `<span class="passage-section">§ ${esc(hit.section)}</span>` : '';
|
const section = hit.section ? `<span class="passage-section">§ ${esc(hit.section)}</span>` : '';
|
||||||
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user