aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/static
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2026-09-16 00:00:57 +0300
committergrm <grm@eyesin.space>2026-09-16 00:00:57 +0300
commit839343a3108734a15e331b542a20ed9c77ef582b (patch)
treea6aabc8719c16398bf1ccd874a7efe865b364a9e /internal/web/static
parent628dcb814ece6335667e2b719049728aa161d8c9 (diff)
downloadblogspace-839343a3108734a15e331b542a20ed9c77ef582b.tar.gz
blogspace-839343a3108734a15e331b542a20ed9c77ef582b.tar.bz2
blogspace-839343a3108734a15e331b542a20ed9c77ef582b.zip
Add a search box module and a search page
Readers had no way to find a post. The new "search" module goes in the header (a bar under the nav) or a side column (a box with a heading) and is a plain GET form to /search, so it works without JavaScript. The results page lists the published posts of every page whose title or Markdown body matches the query — case-insensitive, each word literal, spaces meaning "anything in between", in order — as title, date and a short snippet with the match marked, 20 per page. modules.kind is a CHECK constraint, so a migration widens it; "search" becomes a reserved page slug so the literal route keeps winning over /{page}. moduleHasSettings now takes the module: a header search box has no heading, hence nothing to edit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/web/static')
-rw-r--r--internal/web/static/blog.css12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/web/static/blog.css b/internal/web/static/blog.css
index e7a6c96..e2bf588 100644
--- a/internal/web/static/blog.css
+++ b/internal/web/static/blog.css
@@ -80,6 +80,18 @@ img { max-width: 100%; height: auto; }
.tc-3 { font-size: 1.2em; }
.tc-4 { font-size: 1.45em; }
.tc-5 { font-size: 1.75em; }
+.site-search { border-bottom: 1px solid rgba(0,0,0,0.1); }
+.search-inner { padding: 0.5em 1em; }
+.search-form { margin: 0; }
+.search-form input { padding: 0.35em 0.5em; font: inherit; max-width: 100%; }
+.search-form button { padding: 0.35em 0.8em; font: inherit; }
+.mod-search input { width: 100%; margin-bottom: 0.4em; }
+.search-page { margin-bottom: 1.5em; }
+.search-results { list-style: none; margin: 0; padding: 0; }
+.search-results li { margin: 0 0 1.2em; }
+.search-results .post-date { display: inline; margin: 0 0 0 0.6em; }
+.snippet { margin: 0.2em 0 0; font-size: 0.92em; opacity: 0.85; }
+.snippet mark { background: rgba(255,220,0,0.45); color: inherit; }
.mod-archive details { margin: 0.2em 0; }
.mod-archive details details { margin-left: 1em; }
.mod-archive summary { cursor: pointer; padding: 0.15em 0; }