mirror of
https://github.com/PR0M3TH3AN/Archivox.git
synced 2025-09-07 14:48:40 +00:00
Merge pull request #35 from PR0M3TH3AN/codex/make-markdown-docs-searchable
Enable full-text search in docs
This commit is contained in:
@@ -65,7 +65,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
if (!doc) return;
|
||||
const a = document.createElement('a');
|
||||
a.href = doc.url;
|
||||
a.innerHTML = '<strong>' + highlight(doc.title, q) + '</strong><br><small>' + highlight(doc.headings, q) + '</small>';
|
||||
const snippet = doc.body ? doc.body.slice(0, 160) + (doc.body.length > 160 ? '...' : '') : '';
|
||||
a.innerHTML = '<strong>' + highlight(doc.title, q) + '</strong><br><small>' + highlight(snippet, q) + '</small>';
|
||||
searchResults.appendChild(a);
|
||||
});
|
||||
searchResults.style.display = 'block';
|
||||
|
Reference in New Issue
Block a user