+ {{.Title}} +
+ {{if .Content}} +{{.Content}}
+ {{end}} + {{if .Engine}} +diff --git a/internal/contracts/main_result.go b/internal/contracts/main_result.go index 20c9231..b5b568a 100644 --- a/internal/contracts/main_result.go +++ b/internal/contracts/main_result.go @@ -14,16 +14,17 @@ type MainResult struct { raw map[string]any // Common fields used by templates (RSS uses: title, url, content, pubdate). - Template string `json:"template"` - Title string `json:"title"` - Content string `json:"content"` - URL *string `json:"url"` - Pubdate *string `json:"pubdate"` + Template string `json:"template"` + Title string `json:"title"` + Content string `json:"content"` + URL *string `json:"url"` + Pubdate *string `json:"pubdate"` + Thumbnail string `json:"thumbnail"` - Engine string `json:"engine"` - Score float64 `json:"score"` - Category string `json:"category"` - Priority string `json:"priority"` + Engine string `json:"engine"` + Score float64 `json:"score"` + Category string `json:"category"` + Priority string `json:"priority"` Positions []int `json:"positions"` Engines []string `json:"engines"` @@ -54,6 +55,7 @@ func (mr *MainResult) UnmarshalJSON(data []byte) error { mr.Title = stringOrEmpty(m["title"]) mr.Content = stringOrEmpty(m["content"]) mr.Engine = stringOrEmpty(m["engine"]) + mr.Thumbnail = stringOrEmpty(m["thumbnail"]) mr.Category = stringOrEmpty(m["category"]) mr.Priority = stringOrEmpty(m["priority"]) @@ -93,20 +95,21 @@ func (mr MainResult) MarshalJSON() ([]byte, error) { // Otherwise, marshal the known fields. m := map[string]any{ - "template": mr.Template, - "title": mr.Title, - "content": mr.Content, - "url": mr.URL, - "pubdate": mr.Pubdate, - "engine": mr.Engine, - "score": mr.Score, - "category": mr.Category, - "priority": mr.Priority, + "template": mr.Template, + "title": mr.Title, + "content": mr.Content, + "url": mr.URL, + "pubdate": mr.Pubdate, + "thumbnail": mr.Thumbnail, + "engine": mr.Engine, + "score": mr.Score, + "category": mr.Category, + "priority": mr.Priority, "positions": mr.Positions, "engines": mr.Engines, - "open_group": mr.OpenGroup, + "open_group": mr.OpenGroup, "close_group": mr.CloseGroup, - "parsed_url": mr.ParsedURL, + "parsed_url": mr.ParsedURL, } return json.Marshal(m) } diff --git a/internal/views/static/css/kafka.css b/internal/views/static/css/kafka.css index 78f82e2..b637860 100644 --- a/internal/views/static/css/kafka.css +++ b/internal/views/static/css/kafka.css @@ -805,3 +805,26 @@ html[data-theme="light"] { opacity: 1; } } + +/* Video result cards */ +.video-result { + display: flex; + gap: 1rem; + align-items: flex-start; +} + +.video-result .result_thumbnail { + flex-shrink: 0; + width: 180px; +} + +.video-result .result_thumbnail img { + width: 100%; + height: auto; + border-radius: var(--radius); +} + +.video-result .result_content_wrapper { + flex: 1; + min-width: 0; +} diff --git a/internal/views/templates/results_inner.html b/internal/views/templates/results_inner.html index b6ad2e4..97aefb1 100644 --- a/internal/views/templates/results_inner.html +++ b/internal/views/templates/results_inner.html @@ -52,7 +52,7 @@
{{.Content}}
+ {{end}} + {{if .Engine}} +