kopia lustrzana https://github.com/cblgh/lieu
finalize fts + ui
rodzic
793a9867cc
commit
bd03b61420
|
@ -142,6 +142,20 @@ nav li {
|
|||
height: auto;
|
||||
}
|
||||
|
||||
/* Search Results */
|
||||
.result-nav-list {
|
||||
display: grid;
|
||||
grid-auto-flow: column;
|
||||
justify-content: start;
|
||||
grid-column-gap: 0.75rem;
|
||||
padding-bottom: 0;
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.result__current {
|
||||
/* font-weight: bold; */
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
|
||||
/* Entries */
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{ template "head" . }}
|
||||
{{ template "nav" . }}
|
||||
<main id="results" class="flow2">
|
||||
<h1>Results</h1>
|
||||
<h1>{{ .Data.Title }}</h1>
|
||||
<form method="GET" class="search">
|
||||
<label for="search">Search {{ .SiteName }}</label>
|
||||
<span class="search__input">
|
||||
|
@ -11,6 +11,18 @@
|
|||
</button>
|
||||
</span>
|
||||
</form>
|
||||
<nav>
|
||||
<ul class="result-nav-list">
|
||||
<li title="content from webring sites only"
|
||||
class="{{ if .Data.IsInternal }} result__current {{ end }}">
|
||||
<a href="/?q={{ .Data.Query }}">Webring</a>
|
||||
</li>
|
||||
<li title="content linked from webring sites, but which reside outside it"
|
||||
class="{{ if .Data.IsInternal | not }} result__current {{ end }}">
|
||||
<a href="/outgoing?q={{ .Data.Query }}">Outgoing</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<article>
|
||||
<ul role="list" class="flow2 two-columns width-126ch">
|
||||
{{ range $index, $a := .Data.Pages }}
|
||||
|
|
|
@ -26,7 +26,9 @@ type TemplateView struct {
|
|||
|
||||
type SearchData struct {
|
||||
Query string
|
||||
Title string
|
||||
Pages []types.PageData
|
||||
IsInternal bool
|
||||
}
|
||||
|
||||
type IndexData struct {
|
||||
|
@ -83,8 +85,10 @@ func (h RequestHandler) searchRoute(res http.ResponseWriter, req *http.Request)
|
|||
}
|
||||
|
||||
view.Data = SearchData{
|
||||
Title: "Results",
|
||||
Query: query,
|
||||
Pages: pages,
|
||||
IsInternal: true,
|
||||
}
|
||||
h.renderView(res, "search", view)
|
||||
}
|
||||
|
@ -112,8 +116,10 @@ func (h RequestHandler) externalSearchRoute(res http.ResponseWriter, req *http.R
|
|||
}
|
||||
|
||||
view.Data = SearchData{
|
||||
Title: "External Results",
|
||||
Query: query,
|
||||
Pages: pages,
|
||||
IsInternal: false,
|
||||
}
|
||||
h.renderView(res, "search", view)
|
||||
}
|
||||
|
@ -191,8 +197,8 @@ func Serve(config types.Config) {
|
|||
|
||||
http.HandleFunc("/about", handler.aboutRoute)
|
||||
http.HandleFunc("/", handler.searchRoute)
|
||||
http.HandleFunc("/external", handler.externalSearchRoute)
|
||||
http.HandleFunc("/random/external", handler.randomExternalRoute)
|
||||
http.HandleFunc("/outgoing", handler.externalSearchRoute)
|
||||
http.HandleFunc("/random/outgoing", handler.randomExternalRoute)
|
||||
http.HandleFunc("/random", handler.randomRoute)
|
||||
http.HandleFunc("/webring", handler.webringRoute)
|
||||
http.HandleFunc("/filtered", handler.filteredRoute)
|
||||
|
|
Ładowanie…
Reference in New Issue