refactor(frontend): port search-zen-50 style to Go templates
Replace React SPA with simple Go templates using search-zen-50 visual style. No JavaScript required - pure HTML/CSS with clean teal accent color scheme, monospace logo, and minimal design. - Simplified base.html without HTMX or autocomplete JS - Clean homepage with centered search box - Results page with sticky header and category tabs - Simplified CSS matching search-zen-50 aesthetics Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
168cb78fab
commit
37420ae5a8
5 changed files with 291 additions and 1411 deletions
|
|
@ -1,58 +1,38 @@
|
|||
{{define "title"}}{{if .Query}}{{.Query}} — {{end}}{{end}}
|
||||
{{define "content"}}
|
||||
<div class="results-layout">
|
||||
<!-- Compact search bar spans all columns -->
|
||||
<div class="search-compact">
|
||||
<div class="search-box">
|
||||
<form method="GET" action="/search" role="search" id="search-form">
|
||||
<input type="text" name="q" id="q" value="{{.Query}}" autocomplete="off" autofocus
|
||||
hx-get="/search" hx-target="#results" hx-trigger="keyup changed delay:500ms" hx-include="this">
|
||||
<button type="submit" class="search-box-submit" aria-label="Search">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<div class="results-container">
|
||||
<div class="results-header">
|
||||
<a href="/" class="results-logo">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
||||
<circle cx="11" cy="11" r="8"/>
|
||||
<path d="m21 21-4.35-4.35"/>
|
||||
</svg>
|
||||
<span>kafka</span>
|
||||
</a>
|
||||
|
||||
<form class="header-search" method="GET" action="/search" role="search">
|
||||
<div class="search-box">
|
||||
<input type="text" name="q" value="{{.Query}}" placeholder="Search…" autocomplete="off">
|
||||
<button type="submit" class="search-btn" aria-label="Search">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="11" cy="11" r="8"/>
|
||||
<path d="m21 21-4.35-4.35"/>
|
||||
</svg>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Center: Results -->
|
||||
<div class="results-column" id="results">
|
||||
<div class="category-tabs" role="tablist">
|
||||
<a href="/search?q={{.Query | urlquery}}&category=" class="category-tab {{if eq .ActiveCategory ""}}active{{end}}">All</a>
|
||||
<a href="/search?q={{.Query | urlquery}}&category=general" class="category-tab {{if eq .ActiveCategory "general"}}active{{end}}">General</a>
|
||||
<a href="/search?q={{.Query | urlquery}}&category=it" class="category-tab {{if eq .ActiveCategory "it"}}active{{end}}">IT</a>
|
||||
<a href="/search?q={{.Query | urlquery}}&category=news" class="category-tab {{if eq .ActiveCategory "news"}}active{{end}}">News</a>
|
||||
<a href="/search?q={{.Query | urlquery}}&category=images" class="category-tab {{if eq .ActiveCategory "images"}}active{{end}}">Images</a>
|
||||
</div>
|
||||
|
||||
<div class="results-content">
|
||||
{{template "results_inner" .}}
|
||||
</div>
|
||||
|
||||
<!-- Right: Knowledge Panel + Related Searches -->
|
||||
<aside class="right-column" id="right-column">
|
||||
{{if and .Infoboxes (gt (len .Infoboxes) 0)}}
|
||||
{{with index .Infoboxes 0}}
|
||||
<div class="knowledge-panel">
|
||||
{{if .img_src}}<img class="knowledge-panel-thumb" src="{{.img_src}}" alt="{{.title}}" loading="lazy">{{end}}
|
||||
{{if .title}}<div class="knowledge-panel-title">{{.title}}</div>{{end}}
|
||||
{{if .content}}<div class="knowledge-panel-content">{{.content}}</div>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{if .Suggestions}}
|
||||
<div class="sidebar-card">
|
||||
<div class="sidebar-card-title">Related Searches</div>
|
||||
<div class="related-searches">
|
||||
{{range .Suggestions}}
|
||||
<a class="related-search-link" href="/search?q={{. | urlquery}}">{{.}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{if .UnresponsiveEngines}}
|
||||
<div class="sidebar-card">
|
||||
<div class="sidebar-card-title">Engine Status</div>
|
||||
<ul class="unresponsive-engines">
|
||||
{{range .UnresponsiveEngines}}<li>{{index . 0}}: {{index . 1}}</li>{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
{{end}}
|
||||
</aside>
|
||||
</div>
|
||||
{{end}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue