diff --git a/claude_code_log/html/templates/components/search.html b/claude_code_log/html/templates/components/search.html
index 634e200..683999d 100644
--- a/claude_code_log/html/templates/components/search.html
+++ b/claude_code_log/html/templates/components/search.html
@@ -54,9 +54,7 @@
currentMatchIndex: 0,
matches: [],
searchIndex: null,
- isIndexPage: window.location.pathname.includes('index.html') ||
- window.location.pathname.endsWith('projects/') ||
- (!window.location.pathname.includes('.html') && window.location.pathname.endsWith('/'))
+ isIndexPage: null
};
// DOM elements
@@ -76,6 +74,9 @@
// Initialize search
function initSearch() {
+ // Detect page type by content rather than URL so it works regardless of filename
+ searchState.isIndexPage = document.querySelector('.project-list') !== null;
+
// Build search index from page content
buildSearchIndex();