MainResult: add Thumbnail field (used by YouTube, images, etc.) video_item.html: new partial for video results with thumbnail display views.go: add templateForResult func + video_item.html to template parse results_inner.html: dispatch to video_item when Template="videos" kafka.css: add .video-result flex layout with thumbnail styling
22 lines
651 B
HTML
22 lines
651 B
HTML
{{define "video_item"}}
|
|
<article class="result video-result">
|
|
{{if .Thumbnail}}
|
|
<div class="result_thumbnail">
|
|
<a href="{{.URL}}" target="_blank" rel="noopener noreferrer">
|
|
<img src="{{.Thumbnail}}" alt="{{.Title}}" loading="lazy">
|
|
</a>
|
|
</div>
|
|
{{end}}
|
|
<div class="result_content_wrapper">
|
|
<h3 class="result_header">
|
|
<a href="{{.URL}}" target="_blank" rel="noopener noreferrer">{{.Title}}</a>
|
|
</h3>
|
|
{{if .Content}}
|
|
<p class="result_content">{{.Content}}</p>
|
|
{{end}}
|
|
{{if .Engine}}
|
|
<div class="result_engine"><span class="engine">{{.Engine}}</span></div>
|
|
{{end}}
|
|
</div>
|
|
</article>
|
|
{{end}}
|