summaryrefslogtreecommitdiffstats
path: root/views/layout.erb
diff options
context:
space:
mode:
authorKen D'Ambrosio <ken@jots.org>2026-06-08 19:11:51 +0000
committerKen D'Ambrosio <ken@jots.org>2026-06-08 19:11:51 +0000
commit00f63c03b7c5de68aea6a2305886bc1953a722b6 (patch)
tree054ff2f9029ea57c50da6e823982648f8766ec98 /views/layout.erb
parent01f52565f460a0107679999588b73b770f01a98c (diff)
Add photo search with Boolean operators
- Server-side search index built from all album.json files + people.json, cached in memory for 5 minutes. Each photo document includes filename, album path words, title, caption, camera, date parts (year/month-name/ full date), and person names. - Recursive-descent Boolean parser: AND (explicit or implicit between consecutive terms), OR, NOT, with standard precedence. - GET /search?q=... returns a photo grid (max 300 results) linking each photo back to its album lightbox. - Search box added to the site header; hidden on mobile. - Results show filename, date, person names, and album path per photo. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'views/layout.erb')
-rw-r--r--views/layout.erb5
1 files changed, 5 insertions, 0 deletions
diff --git a/views/layout.erb b/views/layout.erb
index e0c5399..7069e76 100644
--- a/views/layout.erb
+++ b/views/layout.erb
@@ -16,6 +16,11 @@
<body>
<header class="site-header">
<a href="/browse/" class="site-logo">Albumen</a>
+ <form action="/search" method="get" class="header-search">
+ <input type="search" name="q" placeholder="Search…" autocomplete="off"
+ value="<%= defined?(@search_query) ? ERB::Util.html_escape(@search_query.to_s) : '' %>"
+ class="header-search-input">
+ </form>
<nav class="site-nav">
<% if FACES_ENABLED %><a href="/people">People</a><% end %>
<% if admin? %>