Improve the search results view

This commit is contained in:
James Mills
2021-02-02 23:34:18 +10:00
parent 867b7b141d
commit 4c02ee5afc
5 changed files with 20 additions and 392 deletions

View File

@@ -5,6 +5,7 @@ import (
"html/template"
"net/http"
"strings"
"time"
rice "github.com/GeertJohan/go.rice"
"github.com/gomarkdown/markdown"
@@ -184,6 +185,8 @@ func (s *Server) SearchHandler() httprouter.Handle {
ctx.SearchQuery = q
ctx.Results = results
ctx.Matches = searchResults.Total
ctx.Duration = searchResults.Took.Truncate(time.Nanosecond)
s.render("search", w, ctx)
}