Improve the search results view
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user